Reputation: 287830
When you start Swagger UI with Springfox in a Spring Boot app, it looks like this:
How do you configure the title and description ("Api Documentation") and the license (Apache 2.0).
Upvotes: 2
Views: 2240
Reputation: 1250
Swagger config class (Spring boot):
@Configuration
public class SpringFoxConfig {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build();
}
ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("Demo Test API")
.description("Demo test API task")
.license("© 2021 by my")
.build();
}
}
Upvotes: 1
Reputation: 14411
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.
Upvotes: 6