openapi: "3.0.1"
info:
  version: 1.0.0
  title: allOf discriminator issue
paths:
  /sleep:
    patch:
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserSleep'
      responses:
        '200':
          description: Updated
components:
  schemas:
    UserSleep:
      allOf:
        - $ref: '#/components/schemas/UserTimeBase'
        - type: object
          additionalProperties: true
    UserTimeBase:
      required:
        - "$type"
      type: object
      properties:
        "$type":
          type: string
        start:
          type: string
          nullable: true
        end:
          type: string
          nullable: true
      additionalProperties: true
      discriminator:
        propertyName: "$type"