'OpenAPI models not being generated when using oneOf

I am using OpenAPI+OpenAPI-generator with spring boot, and trying to use the schema oneof as follows:

This is the configuration in the requests.yaml file:

...

requestBody:
 name: request
 required: true
 content:
   application/json:
     schema:
       oneOf:
         - $ref: 'components.yaml#/Request'
         - $ref: 'components.yaml#/ComplexRequest'

...

and this is the relevant configuration in the components.yaml file:

Request:
  allOf:
    - $ref: '#/BaseInfo'
    - type: object
      properties:
        should_create:
          type: boolean
          enum: [ false ]
        reference_id:
          type: string
        required:
          - reference_id

ComplexRequest:
  allOf:
    - $ref: '#/BaseInfo'
    - type: object
      properties:
        should_create:
          type: boolean
          enum: [ true ]
        create_data:
          $ref: '#/Reference'
      required:
        - create_data

BaseInfo:
  type: object
  properties:
    customer_id:
      type: string

Reference:
  type: object
  properties:
    propery_1:
      type: string
    propery_2:
      type: string
    propery_3:
      type: string

For some reason, all of these components and only these are not being generated. Can someone enlighten me on what am I doing wrong here?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source