Starter to autoconfigure Swagger2 for Springboot. The project focuses on getting the user to use Swagger as soon as possible with the least amount of configuration.
All needed to start using the project is to add the dependency to the POM and that's it.
<dependency>
<groupId>com.github.sparkmuse</groupId>
<artifactId>swagger2-spring-boot-starter</artifactId>
<version>1.0.0</version>
</dependency>
Add a file bellow to change the default configurations as needed.
swagger:
group: Main group
path-ant-expressions: /api/**,/foo/**
api-info:
title: Api Title
description: My awesome description
version: 1.0
terms-of-service-url: url
license: ApiInfo License
license-url: Licence Url
contact:
name: Contact Name
url: contact-url.com
email: contact@email.com
Note: Notice there is no space between the ant expressions in the ant paths
The auto-configuration processor will enhance the existing configuration with the new ones added. You need to override only what's needed. So if the only change needed is the name of the contact then the configuration bellow will suffice.
swagger:
api-info:
contact:
name: Awesome new name
Security can be easily configured. We support three types out of the box: basic, api, oauth
swagger:
security:
basic: true
swagger:
security:
api:
key-name: key
vehicle: header
swagger:
security:
oauth:
scopes:
- read
- write
token-request:
client-secret-name: secret
client-id-name: id
url: /authorize
token:
url: /token
token-name: token