Discussions

Ask a Question
Back to All

Bug with displaying OpenAPI oneOf options

I am uploading an OpenAPI specification to the UI that has oneOf options:

    CompanyInfoField:
      oneOf:
      - "$ref": "#/components/schemas/company_name"
      - "$ref": "#/components/schemas/industry"
    company_name:
      type: object
      description: The name of the company owning the domain
    industry:
      type: object
      description: 'Example: technology'

The intended encoding of the schema above (which is correct in Redoc and Swagger) is a list of the oneOf options:

[
		"company_name",
    "industry"
]

However, in the readme.io UI, it interprets it as a key-value pair. The UI also does not display a list or dropdown of the oneOf options - instead it presents a box for "New Key" and a box for "New Value", even though the options (like company_name) do not have sub-properties in the OpenAPI specification.

[
  {
    "newKey": "xxxx"
  }
]

I'm also encountering issues with a second oneOf schema for OpenAPI:

    DomainSource:
      oneOf:
      - "$ref": "#/components/schemas/portfolio"
      - "$ref": "#/components/schemas/url_list"
    portfolio:
      required:
      - portfolio_id
      type: object
      properties:
        portfolio_id:
          type: string
          description: Portfolio UUID

The expected encoding of the above example is (which is correct in Swagger and Redoc):

"portfolio": {
	"portfolio_id": "00000000-0000-0000-0000-000000000000"
}

However, in the readme.io UI, the encoding is instead just the following, which appears under a dropdown under "Option 1". In addition to "Option 1" not rendering the portfolio name at all, "Option 1" also changes the intended encoding by erasing the portfolio part of the schema (and just encoding the schema under it)

"portfolio_id": "00000000-0000-0000-0000-000000000000"