Skip to content

@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) #1663

Closed
@solita-alperttiti

Description

@solita-alperttiti

Describe 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    incompleteincomplete description: Make sure you Provide a Minimal, Reproducible Example - with HelloController

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions