Search code examples
springspring-bootswaggerswagger-uispringfox

How do you configure the title, description and license in Springfox Swagger UI?


When you start Swagger UI with Springfox in a Spring Boot app, it looks like this:

enter image description here

How do you configure the title and description ("Api Documentation") and the license (Apache 2.0).


Solution

  • You can set these values by passing the ApiInfo object to your docket.

    new Docket(DocumentationType.SWAGGER_2)
        ...
        .apiInfo(new ApiInfo(...))
        ...
    

    ApiInfo's constructor accepts several details about your API. In you case, you should look at title, description, and license parameters.