Forum Discussion

Stoplight's avatar
Stoplight
Community Manager
2 months ago
Solved

Is there a way to re-label object for OneOf schemas

Originally posted by user sam_immutable to the Stoplight Community on 09/10/2023 at 22:35 ET.

We are hoping to show the underlying Object name instead of a list of "Object" as the options in that drop down. 

Our schema looks like:

ActivityDetails:
      description: The activity details
      oneOf:
        - $ref: '#/components/schemas/example1'
        - $ref: '#/components/schemas/example2'
        - $ref: '#/components/schemas/example3'
        - $ref: '#/components/schemas/example4'
        - $ref: '#/components/schemas/example5'
        - $ref: '#/components/schemas/example6'

Each of the example refs look something like

example1:
      type: object 

So instead of object in the drop down. We'd like to show "example1"

Is that possible?

  • naumanali (Staff) [09/14/2023 - 21:52 ET]

    👋  If you add a title to those schemas, it should show up!

1 Reply

  • Stoplight's avatar
    Stoplight
    Community Manager

    naumanali (Staff) [09/14/2023 - 21:52 ET]

    👋  If you add a title to those schemas, it should show up!