{
  "openapi": "3.0.1",
  "info": {
    "title": "Sample | responses",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "http://localhost/"
    }
  ],
  "paths": {
    "/responses/200-add-xml": {
      "get": {
        "tags": [
          "Sample"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Todo"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/Todo"
                }
              }
            }
          }
        }
      }
    },
    "/responses/200-only-xml": {
      "get": {
        "tags": [
          "Sample"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/Todo"
                }
              }
            }
          }
        }
      }
    },
    "/responses/triangle": {
      "get": {
        "tags": [
          "Sample"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Triangle"
                }
              }
            }
          }
        }
      }
    },
    "/responses/shape": {
      "get": {
        "tags": [
          "Sample"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Shape"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Shape": {
        "required": [
          "$type"
        ],
        "type": "object",
        "anyOf": [
          {
            "$ref": "#/components/schemas/ShapeTriangle"
          },
          {
            "$ref": "#/components/schemas/ShapeSquare"
          }
        ],
        "discriminator": {
          "propertyName": "$type",
          "mapping": {
            "triangle": "#/components/schemas/ShapeTriangle",
            "square": "#/components/schemas/ShapeSquare"
          }
        }
      },
      "ShapeSquare": {
        "properties": {
          "$type": {
            "enum": [
              "square"
            ],
            "type": "string"
          },
          "area": {
            "type": "number",
            "format": "double"
          },
          "color": {
            "type": "string"
          },
          "sides": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ShapeTriangle": {
        "properties": {
          "$type": {
            "enum": [
              "triangle"
            ],
            "type": "string"
          },
          "hypotenuse": {
            "type": "number",
            "format": "double"
          },
          "color": {
            "type": "string"
          },
          "sides": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "Todo": {
        "required": [
          "id",
          "title",
          "completed",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "title": {
            "type": "string"
          },
          "completed": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Triangle": {
        "type": "object",
        "properties": {
          "hypotenuse": {
            "type": "number",
            "format": "double"
          },
          "color": {
            "type": "string"
          },
          "sides": {
            "type": "integer",
            "format": "int32"
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Sample"
    }
  ]
}