Firstly, the below dependency has nothing to do with the issue you are mentioning.
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-security</artifactId>
<version>1.5.2</version>
</dependency>
Now to answer your question.
The URL http://localhost:8081/swagger-ui/index.html comes from the Swagger-Core library upon which Springdoc is built and thus it will serve the default Petstore example. Though this page can be disabled using the below property in application.properties
file.
springdoc.swagger-ui.disable-swagger-default-url=true
But that holds only for version v1.4.1 and above.
Why /v3/api-docs/swagger-config ?
Now in the URl http://localhost:8081/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config the query parameter configUrl
specifies from where to fetch the Springdoc's Swagger-specific configuration file.
Now if you actually hit the URL http://localhost:8081/v3/api-docs/swagger-config, you'll get a config file that's similar to the one below
{
"configUrl": "/v3/api-docs/swagger-config",
"docExpansion": "none",
"urls": [
{
"url": "/v3/api-docs/default",
"name": "default"
}
],
"validatorUrl": ""
}
The urls
object encompasses individual objects for each API-group. Each API group is shown in the Swagger-UI as shown below

Now, for each API group, these properties are used by Springdoc to render the Swagger-UI by fetching the OpenAPI specification file from the given url
and the name
is rendered as shown in the above image.
As for the docExpansion
property, it's set to none
as that setting was explicitly specified in my application.properties
Playing with Properties
springdoc.swagger-ui.configUrl=/mySpringdocConfig
- Use the below property to override the URL where your Springdoc's Swagger-UI loads. Defaults to
/swagger-ui.html
, and that's why Swagger-UI is available at http://localhost:8081/swagger-ui.html
springdoc.swagger-ui.path=/mySwagger-UIPath
Conclusion
I don't think it's possible to get rid of the ?configUrl=/v3/api-docs/swagger-config
from the URL, as it'll always be available and point to the location from where Sprinfdoc's configuration file will be fetched, which if not available will lead to an error in fetching the configuration file and thus make the Swagger-UI useless. Also, it's something you'll not want to get rid of as it's being used by the framework itself.
Refer here for a list of all the supported properties to customize the behavior of Springdoc.