@kush parsaniya's comment seems to be right. There is a problem with version 2.6.0
of springdoc-openapi-starter-webmvc-ui
. The issue has also been reported a few months ago. Take a look over here: https://github.com/springdoc/springdoc-openapi/issues/2740.
Please do not downgrade to an older version, as it might pose vulnerabilities. I tried to upgrade to 2.7.0
(latest stable version), and it seems to be working properly.