shaik fazeel
shaik fazeel

Reputation: 71

How do I remove "api-resource-controller" from my openapi swagger

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?

enter image description here

Upvotes: 7

Views: 8259

Answers (3)

kameshsr
kameshsr

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

thepaoloboi
thepaoloboi

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

user11878890
user11878890

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

Related Questions