Skip to content

Examples with Valid Request / Response Pairs #1742

Closed
@chatelao

Description

@chatelao

Goal:

  • Be able to define 1..N vaild request / response pairs as examples.

Use

  • This pairs could be used to test the final implementation.
  • This pairs could be used to generate easy a some mock for the interfaces.
{
  "paths": {
    "/pets": {
      "get": {
        "summary": "List all pets",
        "operationId": "listPets",
        "parameters": "...",
        "responses": "...",
        "examples": {
          "example_one": {
            "request": {
              "parameters": {
                "limit": 10
              }
            },
            "response": {
              "status": 200,
              "headers": {
                "x-next": 11
              },
              "content": {
                "application/json": {
                  "id": 55226688,
                  "category": {
                    "id": 0,
                    "name": "string"
                  },
                  "name": "doggie",
                  "photoUrls": [
                    "string"
                  ],
                  "tags": [
                    {
                      "id": 0,
                      "name": "string"
                    }
                  ],
                  "status": "available"
                }
              }
            }
          }
        }
      }
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions