Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enum field and allowableValues constraint #2949

Open
gtors opened this issue Sep 7, 2018 · 2 comments
Open

Enum field and allowableValues constraint #2949

gtors opened this issue Sep 7, 2018 · 2 comments

Comments

@gtors
Copy link

gtors commented Sep 7, 2018

Description:
The allowableValues parameter not restricts enum values:

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
@guredd
Copy link

guredd commented Jul 8, 2020

@gtors btw, adding @Schema(type="string", allowableValues=['A' , 'B']) fixes this while it is still not obvious.

@RInverid
Copy link

RInverid commented Apr 9, 2024

You can also @Hidden the default values

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants