Discussions

Ask a Question
Back to All

Array property items with oneOf $ref lists supported?

I have a OpenAPI definition that renders as expected when using another openapi viewer called StopLight . I'm trying to load this yml file to our readme site and am encountering an issue with the UI not rendering correctly for array properties using oneOf with $ref's. The property in question is defined like the following:

. configuration_options: type: array description: List of configuration options to present to users when they configure your adapter. The values the user entered for these configuration options will included in the payload send to your webhook_url when your adapter is invoked. items: oneOf: - $ref: "#/components/schemas/StringConfigurationOption" - $ref: "#/components/schemas/RegExConfigurationOption" - $ref: "#/components/schemas/PasswordConfigurationOption"

The UI that is generated for this property does not render the item references correctly. It renders the array portion ok, offering the Add button with a panel for each valid schema allowed for the configuration_options array, but it does not correctly render the shape of each of these schemas if you click to add one.

It renders the description but does not display the shape of the ref'ed schema. It simply shows an "Add Field" panel that allows the user to add a key/value rather than the actual defined schema properties.

Below is an abbreviated sample of what the StringConfigurationOption looks like (and it's abstract parent):

AbstractConfigurationOption: type: object description: A single UI component that the user will utilize to enter any configuration values that your adapter will require to function. properties: name: type: string description: The name of the configuration option that will be passed to your webhook. example: client_code label: type: string description: The name of the option that will be displayed to the user.

StringConfigurationOption: title: StringConfigurationOption type: object description: A UI component that accepts string user input. allOf: - $ref: "#/components/schemas/AbstractConfigurationOption" - type: object properties: config_type: type: string enum: [ string ]