﻿{
  "openapi": "3.0.4",
  "info": {
    "title": "NswagClientExample",
    "version": "1.0"
  },
  "paths": {
    "/Animals": {
      "post": {
        "tags": [
          "Animals"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/Animal"
                  },
                  {
                    "$ref": "#/components/schemas/Cat"
                  },
                  {
                    "$ref": "#/components/schemas/Dog"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/Animal"
                  },
                  {
                    "$ref": "#/components/schemas/Cat"
                  },
                  {
                    "$ref": "#/components/schemas/Dog"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/Animal"
                  },
                  {
                    "$ref": "#/components/schemas/Cat"
                  },
                  {
                    "$ref": "#/components/schemas/Dog"
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/SecondLevel": {
      "post": {
        "tags": [
          "SecondLevel"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/SubSubType"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/SubSubType"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/SubSubType"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "integer",
                  "format": "int32"
                }
              }
            }
          }
        }
      }
    },
    "/SystemTextJsonAnimals": {
      "post": {
        "tags": [
          "SystemTextJsonAnimals"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/SystemTextJsonAnimal"
                  },
                  {
                    "$ref": "#/components/schemas/SystemTextJsonCat"
                  },
                  {
                    "$ref": "#/components/schemas/SystemTextJsonDog"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/SystemTextJsonAnimal"
                  },
                  {
                    "$ref": "#/components/schemas/SystemTextJsonCat"
                  },
                  {
                    "$ref": "#/components/schemas/SystemTextJsonDog"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/SystemTextJsonAnimal"
                  },
                  {
                    "$ref": "#/components/schemas/SystemTextJsonCat"
                  },
                  {
                    "$ref": "#/components/schemas/SystemTextJsonDog"
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/SystemTextJsonDefaultDiscriminatorAnimals": {
      "post": {
        "tags": [
          "SystemTextJsonDefaultDiscriminatorAnimals"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/SystemTextJsonDefaultDiscriminatorAnimal"
                  },
                  {
                    "$ref": "#/components/schemas/SystemTextJsonDefaultDiscriminatorCat"
                  },
                  {
                    "$ref": "#/components/schemas/SystemTextJsonDefaultDiscriminatorDog"
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/SystemTextJsonDefaultDiscriminatorAnimal"
                  },
                  {
                    "$ref": "#/components/schemas/SystemTextJsonDefaultDiscriminatorCat"
                  },
                  {
                    "$ref": "#/components/schemas/SystemTextJsonDefaultDiscriminatorDog"
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/SystemTextJsonDefaultDiscriminatorAnimal"
                  },
                  {
                    "$ref": "#/components/schemas/SystemTextJsonDefaultDiscriminatorCat"
                  },
                  {
                    "$ref": "#/components/schemas/SystemTextJsonDefaultDiscriminatorDog"
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Animal": {
        "required": [
          "animalType"
        ],
        "type": "object",
        "properties": {
          "animalType": {
            "$ref": "#/components/schemas/AnimalType"
          }
        },
        "additionalProperties": false,
        "discriminator": {
          "propertyName": "animalType",
          "mapping": {
            "Cat": "#/components/schemas/Cat",
            "Dog": "#/components/schemas/Dog"
          }
        }
      },
      "AnimalType": {
        "enum": [
          "Cat",
          "Dog"
        ],
        "type": "string"
      },
      "BaseType": {
        "required": [
          "discriminator"
        ],
        "type": "object",
        "properties": {
          "discriminator": {
            "type": "string"
          },
          "property": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "discriminator": {
          "propertyName": "discriminator",
          "mapping": {
            "SubSubType": "#/components/schemas/SubSubType"
          }
        }
      },
      "Cat": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Animal"
          },
          {
            "type": "object",
            "properties": {
              "catSpecificProperty": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "Dog": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Animal"
          },
          {
            "type": "object",
            "properties": {
              "dogSpecificProperty": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "SubSubType": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BaseType"
          },
          {
            "type": "object",
            "properties": {
              "property2": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "SystemTextJsonAnimal": {
        "required": [
          "animalType"
        ],
        "type": "object",
        "properties": {
          "animalType": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "discriminator": {
          "propertyName": "animalType",
          "mapping": {
            "Cat": "#/components/schemas/SystemTextJsonCat",
            "Dog": "#/components/schemas/SystemTextJsonDog"
          }
        }
      },
      "SystemTextJsonCat": {
        "allOf": [
          {
            "$ref": "#/components/schemas/SystemTextJsonAnimal"
          },
          {
            "type": "object",
            "properties": {
              "catSpecificProperty": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "SystemTextJsonDefaultDiscriminatorAnimal": {
        "required": [
          "$type"
        ],
        "type": "object",
        "properties": {
          "$type": {
            "type": "string"
          },
          "animalType": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "discriminator": {
          "propertyName": "$type",
          "mapping": {
            "Cat": "#/components/schemas/SystemTextJsonDefaultDiscriminatorCat",
            "Dog": "#/components/schemas/SystemTextJsonDefaultDiscriminatorDog"
          }
        }
      },
      "SystemTextJsonDefaultDiscriminatorCat": {
        "allOf": [
          {
            "$ref": "#/components/schemas/SystemTextJsonDefaultDiscriminatorAnimal"
          },
          {
            "type": "object",
            "properties": {
              "catSpecificProperty": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "SystemTextJsonDefaultDiscriminatorDog": {
        "allOf": [
          {
            "$ref": "#/components/schemas/SystemTextJsonDefaultDiscriminatorAnimal"
          },
          {
            "type": "object",
            "properties": {
              "dogSpecificProperty": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "SystemTextJsonDog": {
        "allOf": [
          {
            "$ref": "#/components/schemas/SystemTextJsonAnimal"
          },
          {
            "type": "object",
            "properties": {
              "dogSpecificProperty": {
                "type": "string",
                "nullable": true
              }
            },
            "additionalProperties": false
          }
        ]
      }
    }
  },
  "tags": [
    {
      "name": "Animals"
    },
    {
      "name": "SecondLevel"
    },
    {
      "name": "SystemTextJsonAnimals"
    },
    {
      "name": "SystemTextJsonDefaultDiscriminatorAnimals"
    }
  ]
}