Search code examples
swagger-uiswagger-2.0

Swagger v3 - Selecting multiple values from given set of values


I have a parameter that a list of Strings, but the values must belong from a set of values.

This is what I have tried

@Parameter(description = "The type of status filters", content = @Content(array = @ArraySchema(schema = @Schema(implementation = String.class, allowableValues = {"Option 1", "Option 2", "Option 3"}))))

What I'm currently getting current output

As you can see, there is a text field.

I would like to have a drop-down instead.

Any suggestions on how to do it?


Solution

  • Solved by removing the implementation part

    @Parameter(description = "The type of status filters", content = @Content(array = @ArraySchema(schema = @Schema(allowableValues = {"Option 1", "Option 2", "Option 3"}))))