Skip to content

A few different configurations for documenting Spring web services using Springfox Swagger.

License

Notifications You must be signed in to change notification settings

elvisnovoa/springfox-swagger-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

springfox-swagger-sample

A basic Spring Boot app with single RESTController serving randomly generated data using Podam Factory. Showcases a few different configurations for documenting web services using Springfox Swagger.

To use Springfox, your controllers will need to be annotated with @RequestMapping at the class level (regardless of method-level annotations). Additionally, you will need a configuration class annotated with @EnableSwagger2 and at least one @Bean that returns a Docket instance. You can find this in the SwaggerConfig class.

Different configurations can be enabled by switching between the following Spring Profiles using the spring.profiles.active property in application.properties.

  1. swagger-basic - barebones configuration

  2. swagger-security - adds a required header (ie. "Authorization = Bearer {OAuth2 Token})

  3. swagger-custom - other customizations including reading API info from a properties file.

Prerequisites

Lombok - To run this code from eclipse, you’ll need to install Lombok.

About

A few different configurations for documenting Spring web services using Springfox Swagger.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages