api-spec-converter icon indicating copy to clipboard operation
api-spec-converter copied to clipboard

openapi_3 > swagger_2: oneOf converts to {}

Open mbohgard opened this issue 5 years ago • 1 comments

In the following schema excerpt:

GenericError:
  oneOf:
    - type: object
      required:
        - error_code
        - error_message
      properties:
        error_code:
          type: string
        error_message:
          type: string
      description: An error response with a message in the body
    - type: object
      required:
        - error_code
        - error_messages
        - error_message
      properties:
        error_code:
          type: string
        error_messages:
          type: array
          items:
            type: string
        error_message:
          type: string
      description: An error response with a message in the body

...the resulting schema looks like this:

GenericError: {}

mbohgard avatar Oct 10 '19 08:10 mbohgard

Unfortunately, oneOf is not supported in swagger 2.

rbren avatar Oct 11 '19 15:10 rbren