This is my controller method where the enum is accepted

@GetMapping("/{sortBy}/{page}/{size}")
    public ResponseDto<ReviewsResponseDto, Void> searchAllReviews(
            @PathVariable(value = "sortBy") ReviewsSortBy sortBy,
            @PathVariable Integer page, @PathVariable Integer size) 

This is my enum ReviewsSortBy

@Getter
@ToString
public enum ReviewsSortBy {
      DEFAULT,
      FEATURED,
      RECENT;
}

Now the problem is that swagger doesnt display the possible values of enum in dropdown, instead it just displays "ReviewsSortBy()" as the only selectable value in the dropdown list of the same.

NOTE : Swagger version 2.9.2

Here is the screenshot for the same. swagger dropdown issue with enums

0 Answers