Long title! Huge problem!

I haven't used springfox / swagger in a couple years, but the toolchain seems to be a complete disaster.

  • 2.9.x versions are bringing in old versions of Guava, et al that would require a large amount of effort to sift through.
  • 2.10.x is not supposed to be used!?!
  • 3.0.0 has a spring boot starter, but it brings in spring data rest

I had no idea there was a need / product to have REST interfaces laid over your repository calls, so that was a weird journey.

Nevertheless, the issue arises when your spring data rest autoconfiguration fails. In my particular instance this was due to the legacy database project having some ambiguous calls that were not mappable.

  • Excluding it from the starter did not work.
  • Adding the auto configuration to @SpringBootApplication excludes did not work

In order to turn this off, you have to create a class that implements RepositoryRestConfigurer.

Override configureRepositoryRestConfiguration() and call disableDefaultExposure() on RepositoryRestConfiguration.

public class NoopRepositoryRestConfigurer implements RepositoryRestConfigurer {

  public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config, CorsRegistry cors) {