1 package info.mikethomas.fahservices.config;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 import io.swagger.v3.oas.models.OpenAPI;
26 import io.swagger.v3.oas.models.info.Contact;
27 import io.swagger.v3.oas.models.info.Info;
28 import io.swagger.v3.oas.models.info.License;
29 import io.swagger.v3.oas.models.servers.Server;
30
31 import org.springframework.context.annotation.Bean;
32 import org.springframework.context.annotation.Configuration;
33
34 import java.util.List;
35
36
37
38
39
40
41
42
43 @Configuration
44 public class SwaggerInitConfig {
45
46
47
48
49
50
51 @Bean
52 public OpenAPI apiInfo() {
53 var devServer = new Server()
54 .url("http://localhost:8080")
55 .description("Development Server URL");
56
57 var contact = new Contact()
58 .name("Mike Thomas")
59 .url("http://mikethomas.info")
60 .email("mikepthomas@outlook.com");
61
62 var license = new License()
63 .name("The GNU General Public License, Version 3")
64 .url("http://www.gnu.org/copyleft/gpl.html");
65
66 var info = new Info()
67 .title("FAHServices")
68 .description("Web services to connect to a folding@home v7 client")
69 .version("1.2")
70 .contact(contact)
71 .license(license);
72
73 return new OpenAPI().info(info).servers(List.of(devServer));
74 }
75 }