Open gtors opened 6 years ago
Description: The allowableValues parameter not restricts enum values:
allowableValues
enum MyEnum { A, B, C }
// groovy @Schema(allowableValues=['A' , 'B']) MyEnum field
Expected behavior:
allowableValues will restrict enum values in SwaggerUI to A, B
Actual behavior:
allowableValues extends enum values in SwaggerUI to A, B, C, A, B
io.swagger.core.v3:swagger-core:2.0.0 io.swagger.core.v3:swagger-annotations:2.0.0 io.swagger.core.v3:swagger-annotations:2.0.0 io.swagger.core.v3:swagger-jaxrs2:2.0.0 io.swagger.core.v3:swagger-integration:2.0.0
@gtors btw, adding @Schema(type="string", allowableValues=['A' , 'B']) fixes this while it is still not obvious.
@Schema(type="string", allowableValues=['A' , 'B'])
You can also @Hidden the default values
@Hidden
Description: The
allowableValues
parameter not restricts enum values:Expected behavior:
allowableValues
will restrict enum values in SwaggerUI to A, BActual behavior:
allowableValues
extends enum values in SwaggerUI to A, B, C, A, B