-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Closed
Labels
Description
Q&A (please complete the following information)
- OS: Ubuntu 18.04
- Browser: Chrome
- Version: 75
- Method of installation: Docker
- Swagger-UI version: 3.23.0
- Swagger/OpenAPI version: OpenAPI 3.0
Content & configuration
OpenAPI definition:
openapi: "3.0.0"
info:
title: Testcase API
version: 2.0.0
paths:
'/endpoint':
get:
parameters:
- name: type
in: query
example: fruit
schema:
type: string
enum:
- fruit
- vegetable
- drink
responses:
'200':
description: 200 responseDescribe the bug you're encountering
Selecting the -- choice in a dropdown menu throws an error about not being able to render the component.
To reproduce...
Steps to reproduce the behavior:
- Go to the Swagger Editor
- Copy/paste the YAML definition
- Select the
--choice in the dropdown for thetypeparameter. - See following error:
😱 Could not render this component, see the console.
Expected behavior
No error should be reported to the user, the dropdown should support being set to --.
Screenshots
Additional context or thoughts
The issue has apparently to do with code at https://github.com/swagger-api/swagger-ui/blob/master/src/core/components/layout-utils.jsx#L187.
The value of this.state.value is null for the -- select option, thus failing when trying to access the .toJS property.
Or am I simply missing something obvious in my OpenAPI definition?!?

