openapi: 3.0.0
info:
  title: ACME
  version: 1.0.0

paths:
  /pets:
    post:
      operationId: updatePets
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - $ref: "#/components/schemas/Dog"
                - $ref: "#/components/schemas/Cat"

components:
  schemas:
    Dog:
      type: object
      properties:
        petType:
          type: string
        name:
          type: string
        breed:
          type: object
          oneOf:
            - $ref: "#/components/schemas/Breed1"
            - $ref: "#/components/schemas/Breed2"

    Breed1:
      type: object
      properties:
        name:
          type: string

    Breed2:
      type: object
      properties:
        name:
          type: string

    Cat:
      type: object
      properties:
        petType:
          type: string
        name:
          type: string
