Adding a Maven dependency

There is a Maven dependency required to have the SpringFox implementation of the Swagger 2 specification in your Account microservice project:

<dependency> 
   <groupId>io.springfox</groupId> 
   <artifactId>springfox-swagger2</artifactId> 
   <version>${swagger.version}</version> 
</dependency>

In the preceding Maven dependency, we have added the SpringFox Maven dependency for Swagger 2 with groupId io.springfox and the springfox-swagger2 artifact ID. Let's configure Swagger using the following configuration:

<properties> 
   ... 
   <swagger.version>2.7.0</swagger.version> 
</properties> 

After adding the Swagger 2 dependency with our example of the Account microservice, let's integrate the Swagger 2 configuration.

Get Mastering Spring Boot 2.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.