Reputation: 71
I'm currently using the below openapi-ui dependency.
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.4.4</version>
</dependency>
How to remove the api-resource-controller from the openapi-ui swagger screen?
Upvotes: 7
Views: 8259
Reputation: 357
You can remove @EnableSwagger2
from your swagger config file or openapi config file then these openapi-resource controller will authomatically be removed.
Upvotes: 2
Reputation: 888
If you want to hide certain paths, you could use the springdoc.paths-to-exclude property
, documented here.
So, in your case you should use:
# Paths to exclude
springdoc.paths-to-exclude=/swagger-resources/**
Upvotes: 11
Reputation:
You can use the @Hidden
annotation from swagger-annotations, on the top of the controller you want to hide.
Or you can use properties to filter the endpoints to show, filtering by path or package:
# Packages to include
springdoc.packagesToScan=com.package1, com.package2
or
# Paths to include
springdoc.pathsToMatch=/v1, /api/balance/**
Upvotes: 4