Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit 6c79a77

Browse files
committed
added SwaggerConfiguration
1 parent 8e83ad1 commit 6c79a77

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package de.filefighter.rest.config;
2+
3+
import org.springframework.context.annotation.Bean;
4+
import org.springframework.context.annotation.Configuration;
5+
import springfox.documentation.builders.RequestHandlerSelectors;
6+
import springfox.documentation.service.ApiInfo;
7+
import springfox.documentation.service.Contact;
8+
import springfox.documentation.spi.DocumentationType;
9+
import springfox.documentation.spring.web.plugins.Docket;
10+
import springfox.documentation.swagger2.annotations.EnableSwagger2;
11+
12+
import java.util.Collections;
13+
14+
@Configuration
15+
@EnableSwagger2
16+
public class SwaggerConfiguration {
17+
18+
@Bean
19+
public Docket swaggerConfig() {
20+
return new Docket(DocumentationType.SWAGGER_2)
21+
.select()
22+
.apis(RequestHandlerSelectors.basePackage("de.filefighter.rest"))
23+
.build()
24+
.apiInfo(apiInfo());
25+
}
26+
27+
private ApiInfo apiInfo() {
28+
return new ApiInfo(
29+
"FileFighter REST",
30+
"REST-API of the FileFighter application.",
31+
"0.1",
32+
"terms of service url",
33+
new Contact("FileFighter Dev-Team", "https://github.com/filefighter/", "comming soon"),
34+
"MIT License",
35+
"https://github.com/filefighter/restapi/blob/master/LICENSE",
36+
Collections.emptyList()
37+
);
38+
}
39+
}

src/main/java/de/filefighter/rest/health/rest/HealthRestController.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
package de.filefighter.rest.health.rest;
22

33
import de.filefighter.rest.health.data.SystemHealth;
4+
import io.swagger.annotations.Api;
45
import org.springframework.hateoas.EntityModel;
56
import org.springframework.web.bind.annotation.GetMapping;
67
import org.springframework.web.bind.annotation.RequestMapping;
78
import org.springframework.web.bind.annotation.RestController;
89

910
@RestController
11+
@Api(value = "System Health", tags = { "SystemHealth" })
1012
@RequestMapping("/health")
1113
public class HealthRestController {
1214

0 commit comments

Comments
 (0)