Springfox: Migrating code with @EnableSwagger2 annotation gone in master version on 3.0.0-SNAPSHOT

Created on 20 Aug 2018  路  3Comments  路  Source: springfox/springfox

We are using 3.0.0-SNAPSHOT version of springfox because it has the integration with latest release version of spring-data-rest included with spring-boot 2.0.3.RELEASE.

As of yesterday August 19, 2018 the class springfox.documentation.swagger2.annotations.EnableSwagger2 is no longer in the source.

We need to know how to migrate existing code that uses @EnableSwagger2 annotation.

Please take the time to search the repository, if your question has already been asked or answered.

  • [ ] What version of the library are you using? Is it the latest version? The latest released version is Download

3.0.0-SNAPSHOT

What kind of issue is this?

  • [X ] Question. Is this a question about how to do a certain thing?

  • [ ] Bug report. If you鈥檝e found a bug, spend the time to write a failing test. Bugs with tests or
    steps to reproduce get fixed faster. Here鈥檚 an example: https://gist.github.com/swankjesse/6608b4713ad80988cdc9

    • [ ] spring xml/java config that is relevant
    • [ ] springfox specific configuration if it makes sense
    • [ ] include any output you've received; logs, json snippets etc.; and what the expected output should be
    • [ ] if you have a repo that demonstrates the issue for bonus points! See this example

Latest springfox master version: d6c72bf8623b3efaebb3e276154cf98f5fdf8af6

  • [ ] Feature Request. Start by telling us what problem you鈥檙e trying to solve. Often a solution
    already exists! Don鈥檛 send pull requests to implement new features without first getting our
    support. Sometimes we leave features out on purpose to keep the project small.

Please do consider starring this repository if you do like this project and find it useful.

Done. Thanks for a great project!

question

Most helpful comment

OK I have figured it out as follows...

  1. @EnableSwagger2 has been replaced with springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc
  2. We need to explicitly add the following dependencies to build.gradle:
    implementation("io.springfox:springfox-spring-web:${springFoxSwaggerVersion}")
    implementation("io.springfox:springfox-spring-webmvc:${springFoxSwaggerVersion}")

Then we have things working as before. I am closing this issue.

All 3 comments

OK I have figured it out as follows...

  1. @EnableSwagger2 has been replaced with springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc
  2. We need to explicitly add the following dependencies to build.gradle:
    implementation("io.springfox:springfox-spring-web:${springFoxSwaggerVersion}")
    implementation("io.springfox:springfox-spring-webmvc:${springFoxSwaggerVersion}")

Then we have things working as before. I am closing this issue.

@farrukhnajmi, this is still pre-release. It might change before its released.

Hi Guys,
We desperately need this version. Is there any tentative plan for the final release?

Best Regards,

Joga

Was this page helpful?
0 / 5 - 0 ratings