The version of the API displayed at the bottom of the Swagger interface comes from a Swagger document.
Here is an example Swagger doc:
{ "swagger": "2.0", "info": { "description": "This is a sample server Petstore server.", "version": "1.0.0", "title": "Swagger Petstore", ...
"version": "1.0.0" is the default value, but you can change it using the Swagger @Info annotation:
@SwaggerDefinition( info = @Info( description = "This is a sample server Petstore server.", version = "1.0.1", title = "Swagger Petstore"
This document can be added to any class scanned during the Swagger auto-configuration process, according to the Swagger Wiki page :
An annotation can be in any class scanned during the Swagger automatic configuration process, i.e. it should not be in the JAX-RS API class, but may just be in the token / configuration interface
Here you can find some examples: https://github.com/swagger-api/swagger-samples/tree/master/java . Some use jersey and install an API version.
source share