Skip to content

bug: can't unselect first oneOf option inside "Try It" (OAS3.0) #3354

@LuccaBitfly

Description

@LuccaBitfly

Using OpenAPI 3.0, when having an object field with oneOf inside a request body schema, it is not possible to unselect the first listed oneOf option in the UI. For example, using this this as a request body schema:

OneOfSchema:
  type: object
  properties:
    test:
      oneOf:
        - title: "Number input"
          type: object
          properties:
            number_input:
              type: number
        - title: "String input"
          type: object
          properties:
            string_input:
              type: string

When selecting the "String input" option in the "Try It" window:

Image

Then the data preview still shows the example placeholder for the first option, i.e. number_input:

Image

I would expect it to deselect the first option when selecting a different oneOf field, so the payload shown should be:

{
  "test": {
    "string_input": "test test"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions