I am trying to disable swagger in specific environment and I am able to do it by doing a .enable(false) in docket but the UI page still loads SWagger ui frame and displays null on the page. I would like to completely get rid of it but the include patterns option seems to no longer availble , any alternatives ?
Asked
Active
Viewed 358 times
1 Answers
1
You need to use the selection api in the docket (see 4,5,6 & 7).
docket
.select()
.apis(RequestHandlerSelectors.any()) //<1>
.paths(PathSelectors.ant("**/some-api-uri")) //<2>
.build()
- This is a predicate that allows you to filter based on
RequestHandler
s - This is a predicate based on path selection. It comes with some pre-selected ones like
ant
andregex
. You can write your own predicates, but I suspect those will be sufficient for what you're looking for

Dilip Krishnan
- 5,417
- 3
- 37
- 53