Skip to content

Support oneOf #32

@ferranlala

Description

@ferranlala

Given the following schema:

openapi: 3.0.2
info:
  version: 0.7.1
  title: aoide
  description: Music library management
  license:
    name: AGPL-3.0-or-later
    url: 'https://www.gnu.org/licenses/agpl-3.0.html'
paths:
  /date:
    get:
      summary: Get current date
      operationId: date
      parameters:
        - $ref: '#/components/schemas/WRAPPER'
      responses:
        '400':
          $ref: '#/components/schemas/YYYYMMDD'
components:
  schemas:
    WRAPPER:
      oneOf:
        - $ref: '#/components/schemas/YYYYMMDD'
    YYYYMMDD:
      type: object
      required:
        - value
      properties:
              value:
                 type: integer
                 format: int32

The YYYYMMDD struct is generated correctly. But then, bow-openapi generates two empty structs WRAPPER and OneOfWRAPPER.

I would expect WRAPPER to be an enum with a case with an associated value of YYYYMMDD.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions