1 | package org.cardanofoundation.explorer.api.config; | |
2 | ||
3 | import org.springframework.context.annotation.Bean; | |
4 | import org.springframework.context.annotation.Configuration; | |
5 | import org.springframework.context.annotation.Profile; | |
6 | ||
7 | import io.swagger.v3.oas.models.Components; | |
8 | import io.swagger.v3.oas.models.OpenAPI; | |
9 | import io.swagger.v3.oas.models.info.Contact; | |
10 | import io.swagger.v3.oas.models.info.Info; | |
11 | import io.swagger.v3.oas.models.security.SecurityRequirement; | |
12 | import io.swagger.v3.oas.models.security.SecurityScheme; | |
13 | ||
14 | @Configuration | |
15 | @Profile("!prod") | |
16 | public class OpenApiConfig { | |
17 | ||
18 | @Bean | |
19 | public OpenAPI customOpenAPI() { | |
20 | final String securitySchemeNAme = "bearerAuth"; | |
21 |
1
1. customOpenAPI : replaced return value with null for org/cardanofoundation/explorer/api/config/OpenApiConfig::customOpenAPI → NO_COVERAGE |
return new OpenAPI() |
22 | .addSecurityItem(new SecurityRequirement().addList(securitySchemeNAme)) | |
23 | .components( | |
24 | new Components() | |
25 | .addSecuritySchemes( | |
26 | securitySchemeNAme, | |
27 | new SecurityScheme() | |
28 | .name(securitySchemeNAme) | |
29 | .type(SecurityScheme.Type.HTTP) | |
30 | .scheme("bearer") | |
31 | .bearerFormat("JWT"))) | |
32 | .info( | |
33 | new Info() | |
34 | .title("Iris API") | |
35 | .description("Iris API OpenAPI 3.0") | |
36 | .contact( | |
37 | new Contact() | |
38 | .email("info@cardano.com") | |
39 | .name("Cardano") | |
40 | .url("https://cardano.org")) | |
41 | // .license(new License() | |
42 | // .name("Apache 2.0") | |
43 | // .url("http://www.apache.org/licenses/LICENSE-2.0.html")) | |
44 | .version("1.0.0")); | |
45 | } | |
46 | } | |
Mutations | ||
21 |
1.1 |