0

I'm using springfox swagger to document the REST web services under a Spring Boot project, but swagger-ui is not working... I get to the index page and see all the controller agrupations, but when I select any of them, no services are shown. I have followed the instructions as explained here: https://www.baeldung.com/swagger-2-documentation-for-spring-rest-api

Viewing code behind the index page of the swagger-ui I see there are a lot of errors, all of them are the same:

system.js:461 TypeError: Array.prototype.filter called on null or undefined at filter () at system.js:458 at Object.currentFilter (system.js:262) at t.value (filter.jsx:24) at t.render (root-injects.js:93) at u._renderValidatedComponentWithoutOwnerOrContext (ReactCompositeComponent.js:796) at u._renderValidatedComponent (ReactCompositeComponent.js:819) at u.performInitialMount (ReactCompositeComponent.js:359) at u.mountComponent (ReactCompositeComponent.js:255) at Object.mountComponent (ReactReconciler.js:43) (anonymous) @ system.js:461

I have also tried to see if the JSON received by v2/api-docs had anything extrange, but nothing... everything seems fine.

Now something even stranger... I have tried with swagger version 2.8.0, and then swagger-ui shows everything correctly. BUT! If I look at the code behind, the same errors are displayed.

Any recomendation?

Pep Gomez
  • 197
  • 4
  • 14

1 Answers1

0

I finally got it working... the problem was I set up the security of spring to access certain controllers and had added some of thee paths swagger needs at the whitelist, but had missed 2 paths swagger needed. I added them and now everything works fine... here are the paths I have added to the whitelist for swagger to work:

        <url path="/webjars/**" />
        <url path="/v2/**" />
        <url path="/configuration/**" />
        <url path="/swagger*/**" />
Pep Gomez
  • 197
  • 4
  • 14