@Schema annotation with type String and allowableValues set doesn't generate enum drop-down in swagger-ui after upgrading from 1.6.6 (when Spring custom converter is used)
See original GitHub issueDescribe the bug
After upgrading from springdoc-openapi 1.6.6 to 1.6.7/1.6.8 enum drop-down is not visible in swagger-ui.
EDIT: problem is most likely a custom converter with enum (plain or decorated with schema-annotation). More details from comments.
This works with 1.6.6. as expected, but in 1.6.7/1.6.8 there is only normal empty text-field and not the enum drop-down with allowable values:
@Schema(type = "String", allowableValues = {
"foo", "bar"
})
public enum FooBar {
[..]
And enum is used as pathvariable in controller:
@GetMapping(value = "/some/path/{fooBar}")
public void getFooBar(@PathVariable FooBar fooBar) {
[..]
- What version of spring-boot you are using? 2.6.7
- What modules and versions of springdoc-openapi are you using? 1.6.6 works, 1.6.7/1.6.8 doesn’t
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
java - Using @Schema(allowableValues=) for enum param ...
When I generate swagger UI, its showing enum with allowed value as enum names. Instead of enum names, I need to set it...
Read more >F.A.Q - Springdoc-openapi
How can I define multiple OpenAPI definitions in one Spring Boot project? ... For layout options, you can use swagger-ui configuration options. For...
Read more >springdoc-openapi changelog - Awesome Java - LibHunt
#1663 - @Schema annotation with type String and allowableValues set doesn't generate enum drop-down in swagger-ui after upgrading from 1.6.6 (when Spring ......
Read more >springdoc/springdoc-openapi v1.6.9 on GitHub
#1663 - @Schema annotation with type String and allowableValues set doesn't generate enum drop-down in swagger-ui after upgrading from 1.6.6 (when Spring ......
Read more >Springdoc Openapi Versions - Open Source Agenda
#1663 - @Schema annotation with type String and allowableValues set doesn't generate enum drop-down in swagger-ui after upgrading from 1.6.6 (when Spring ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@solita-alperttiti,
Should be fixed with the next release.
This is the workaround, until then
@bnasslahsen I have made a sample project to help reproducing the described behavior easily.
Please see: https://github.com/solita-alperttiti/springdoc-enum-example