'How to configure the selected server environment from the servers dropdown in springdoc?

How can you configure the default selected server from the servers dropdown that gets displayed by springdoc?

I have an OpenAPI specification that contains a servers section with multiple environments (dev, staging, local ...). Currently, sprindoc chooses the first entry as selected by default for the "try out" functions, i would like to configure the selected entry, ideally with an environment variable. Is that possible?

I use springdoc with the following settings:

springdoc.api-docs.enabled=false
springdoc.swagger-ui.url=/my-spec.yaml
springdoc.swagger-ui.use-root-path=true


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source