How to choose parameter values from a dropdown in API Spector
Some parameters accept only a few values. A sort parameter might take asc or desc, a status might be open, closed, or archived. Typing those by hand means remembering the exact spelling and checking the docs when you forget. In API Spector you can pin a parameter to a set of allowed values and pick from a dropdown instead.
Add allowed values to a parameter
Open the Params tab, hover the row you want to constrain, and click the small dropdown toggle that appears next to the value. A short editor opens. Type the allowed values separated by commas:
asc, desc
The value cell turns into a dropdown with those options, and the parameter now accepts only one of them. The same toggle works on the Headers tab for a header that takes a fixed set of values.
Let OpenAPI fill the list
If your parameter is described in an OpenAPI spec with an enum, you do not have to type anything. When you import the spec, API Spector reads the enum and sets it as the parameter's allowed values, with the first value selected. For example, a query parameter declared like this:
- name: sort
in: query
schema:
type: string
enum: [asc, desc]
arrives as a dropdown of asc and desc, ready to use. Path parameters with an enum come across the same way.
Go back to free text
Click the dropdown toggle again to remove the allowed values. The cell returns to a normal text field, where {{variables}} and anything else are accepted as usual. If a value was already set that is not one of the choices, it is kept as an option so nothing is lost when you switch.
Why it helps
A dropdown of valid values is faster than typing, and it removes a whole class of mistakes: the misspelled option, the value that was renamed, the one you could never quite remember. When the allowed values come straight from your OpenAPI spec, the request and the contract agree without any extra work.