0

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 ?

Fancy
  • 11
  • 1
  • 4

1 Answers1

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()
  1. This is a predicate that allows you to filter based on RequestHandlers
  2. This is a predicate based on path selection. It comes with some pre-selected ones like ant and regex. 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