@DefaultValue for enums ignored in openapi.yaml / swagger-ui #14865
Labels
area/openapi
area/smallrye
area/swagger-ui
env/windows
Impacts Windows machines
kind/bug
Something isn't working
Milestone
Describe the bug
Specifying a default value for an enum parameter on a REST API has no effect on the generated openapi.yaml or a pre-selection of the respective value in the swagger-ui.
Expected behavior
Openapi.yaml should specify "DOG" as parameter default and the "DOG" entry should also be pre-selected in swagger-ui.
Actual behavior
The first entry of the enum values sorted alphabetically is pre-selected.
To Reproduce
Steps to reproduce the behavior:
Screenshots
Current Swagger-UI:

Here is a comparison of how the Openapi.yaml is currently generated (left) and how it could be generated to solve this issue (right).
After this change, swagger-ui would render:
Environment (please complete the following information):
uname -a
orver
: Microsoft Windows [Version 10.0.18363.1198]java -version
: openjdk version "11.0.9.1" 2020-11-04 LTSmvnw --version
orgradlew --version
): Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)The text was updated successfully, but these errors were encountered: