Skip to content

Latest commit

 

History

History
593 lines (476 loc) · 13.5 KB

File metadata and controls

593 lines (476 loc) · 13.5 KB

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
ApiKeyAuth header string N/A No API key
BasicAuth header string N/A No Basic authentication
limit query integer No How many items to return at one time (max 100)

Responses

=== "200 OK"

=== "application/json"
    
    
    ```json
    [
        {
            "id": 26,
            "name": "string",
            "tag": "string",
            "category": "One"
        }
    ]
    ```
    <span class="small-note">⚠️</span>&nbsp;<em class="small-note warning">This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.</em>
    
    

    ??? hint "Schema of the response body"
        ```json
        {
            "type": "array",
            "items": {
                "$ref": "#/components/schemas/Pet"
            }
        }
        ```



**Response headers**

| Name | Description | Schema |
| --- | --- | --- |
| `x-next` | A link to the next page of responses |<span class="string-type">string</span> |

=== "Other responses"

=== "application/json"
    
    
    ```json
    {
        "code": 26,
        "message": "string"
    }
    ```
    <span class="small-note">⚠️</span>&nbsp;<em class="small-note warning">This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.</em>
    
    

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

POST /pets

Create a pet

Input parameters

Parameter In Type Default Nullable Description
ApiKeyAuth header string N/A No API key
BasicAuth header string N/A No Basic authentication

Responses

=== "201 Created" === "Other responses"

=== "application/json"
    
    
    ```json
    {
        "code": 26,
        "message": "string"
    }
    ```
    <span class="small-note">⚠️</span>&nbsp;<em class="small-note warning">This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.</em>
    
    

    ??? hint "Schema of the response body"
        ```json
        {
            "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
ApiKeyAuth header string N/A No API key
BasicAuth header string N/A No Basic authentication
petId path string No The id of the pet to retrieve

Responses

=== "200 OK"

=== "application/json"
    
    
    ```json
    {
        "id": 26,
        "name": "string",
        "tag": "string",
        "category": "One"
    }
    ```
    <span class="small-note">⚠️</span>&nbsp;<em class="small-note warning">This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.</em>
    
    

    ??? hint "Schema of the response body"
        ```json
        {
            "type": "object",
            "required": [
                "id",
                "name"
            ],
            "properties": {
                "id": {
                    "type": "integer",
                    "format": "int64"
                },
                "name": {
                    "type": "string"
                },
                "tag": {
                    "type": "string"
                },
                "category": {
                    "type": "string",
                    "enum": [
                        "One",
                        "Two",
                        "Three"
                    ]
                }
            }
        }
        ```

=== "Other responses"

=== "application/json"
    
    
    ```json
    {
        "code": 26,
        "message": "string"
    }
    ```
    <span class="small-note">⚠️</span>&nbsp;<em class="small-note warning">This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.</em>
    
    

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

PATCH /pets/{petId}

Input parameters

Parameter In Type Default Nullable Description
ApiKeyAuth header string N/A No API key
BasicAuth header string N/A No Basic authentication

Request body

=== "application/json"

??? hint "Schema of the request body"
    ```json
    {
        "oneOf": [
            {
                "$ref": "#/components/schemas/Cat"
            },
            {
                "$ref": "#/components/schemas/Dog"
            }
        ]
    }
    ```

Responses

=== "200 OK"


Schemas

Cat

Name Type Description
age integer
hunts boolean

Dog

Name Type Description
bark boolean
breed string

Error

Name Type Description
code integer(int32)
message string

Pet

Name Type Description
category string
id integer(int64)
name string
tag string

Pets

Type: Array<Pet>

PetsIds

Type: Array<integer(int64)>

Security schemes

    <tr>
        <td>BasicAuth</td>
        <td>http</td>
        <td>basic</td>
        <td></td>
    </tr>
    
    <tr>
        <td>ApiKeyAuth</td>
        <td>apiKey</td>
        <td></td>
        <td></td>
    </tr>
    
</tbody>
Name Type Scheme Description