openapi: 3.0.0
info:
  title: Polymorphism
  version: '1'
paths:
  /test:
    get:
      operationId: ef7f8a05d4ce52bae215869c1decc7c1
      responses:
        default:
          description: Polymorphism
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Request'
components:
  schemas:
    Responsible:
      properties:
        type:
          nullable: false
          type: string
          enum:
            - employee
            - assignee
            - fl
      type: object
      discriminator:
        propertyName: type
        mapping:
          fl: '#/components/schemas/FlResponsible'
          employee: '#/components/schemas/EmployeeResponsible'
      oneOf:
        -
          $ref: '#/components/schemas/FlResponsible'
        -
          $ref: '#/components/schemas/EmployeeResponsible'
    EmployeeResponsible:
      allOf:
        -
          properties:
            property2:
              nullable: false
              type: string
        -
          $ref: '#/components/schemas/Responsible'
    FlResponsible:
      allOf:
        -
          properties:
            property3:
              nullable: false
              type: string
        -
          $ref: '#/components/schemas/Responsible'
    Request:
      properties:
        payload:
          $ref: '#/components/schemas/Responsible'
      type: object

