﻿{
  "openapi": "3.0.4",
  "info": {
    "title": "MultipleResponseTypes",
    "version": "v1"
  },
  "paths": {
    "/animals/{id}": {
      "get": {
        "tags": [
          "MultipleResponseTypes"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Cat"
                    },
                    {
                      "$ref": "#/components/schemas/Dog"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Cat": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "livesLeft": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "Dog": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "goodBoy": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      }
    }
  },
  "tags": [
    {
      "name": "MultipleResponseTypes"
    }
  ]
}