Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Try request not initiated without selecting any of the available option(s) from enum #6585
Comments
The parameter definition does not look correct, try this instead: parameters:
- name: parameter1
in: query
description: Dummy parameter
schema:
type: array
items:
type: string
default: Active
enum:
- Active
- Suspended
- Deleted |
That seems to work on Swagger Editor but I have class-level I have the following piece of code at class-level @javax.ws.rs.Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) and I've tried using Any suggestions on how to unset it? |
Q&A
Consider the below OpenAPI definition:
Describe the bug you're encountering
The output is expected as shown below

The bug occurs when the below process is followed
Now, if your Network's tab is open in the browser developer tools, it's observed that there's no request initiated yet the Loading keeps running infinitely.
But if any one of the option is selected as shown below (and optionally immediately de-selected such that the screen looks like the previous one, as if the option was never selected)

and then the Execute button is hit, the request is actually made and also shows up in the Network monitor tab with a response being generated.
Expected behavior
The request should be initiated irrespective of the fact that an option is selected or not (provided it's not a required field).
Suggested Enhancement
It'll be a good idea to consider the
default
value from the OpenAPI spec and have the target value automatically selected.