File tree 23 files changed +39
-21
lines changed
springdoc-openapi-starter-common/src/main/java/org/springdoc
springdoc-openapi-starter-webflux-api/src/test/java/test/org/springdoc/api
springdoc-openapi-starter-webflux-ui/src/test/java/test/org/springdoc/ui
springdoc-openapi-starter-webmvc-api/src/test/java/test/org/springdoc/api
springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui
springdoc-openapi-actuator-webflux-tests/src/test/java/test/org/springdoc/api
springdoc-openapi-actuator-webmvc-tests/src/test/java/test/org/springdoc/api
springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api
springdoc-openapi-function-webflux-tests/src/test/java/test/org/springdoc/api
springdoc-openapi-function-webmvc-tests/src/test/java/test/org/springdoc/api
springdoc-openapi-groovy-tests/src/test/groovy/test/org/springdoc/api
springdoc-openapi-hateoas-tests/src/test/java/test/org/springdoc/api
springdoc-openapi-javadoc-tests/src/test/java/test/org/springdoc/api
springdoc-openapi-kotlin-webflux-tests/src/test
java/test/org/springdoc/api
kotlin/test/org/springdoc/api
springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api
springdoc-openapi-security-tests/src/test/java/test/org/springdoc/api
23 files changed +39
-21
lines changed Original file line number Diff line number Diff line change @@ -510,6 +510,8 @@ private void trimIndentOperation(Operation operation) {
510
510
*/
511
511
protected void calculateWebhooks (OpenAPI calculatedOpenAPI , Locale locale ) {
512
512
Webhooks [] webhooksAttr = openAPIService .getWebhooks ();
513
+ if (ArrayUtils .isEmpty (webhooksAttr ))
514
+ return ;
513
515
var webhooks = Arrays .stream (webhooksAttr ).map (Webhooks ::value ).flatMap (Arrays ::stream ).toArray (Webhook []::new );
514
516
Arrays .stream (webhooks ).forEach (webhook -> {
515
517
io .swagger .v3 .oas .annotations .Operation apiOperation = webhook .operation ();
Original file line number Diff line number Diff line change @@ -1304,7 +1304,7 @@ public static class ApiDocs {
1304
1304
/**
1305
1305
* The OpenAPI version.
1306
1306
*/
1307
- private OpenApiVersion version ;
1307
+ private OpenApiVersion version = OpenApiVersion . OPENAPI_3_1 ;
1308
1308
1309
1309
/**
1310
1310
* Gets path.
Original file line number Diff line number Diff line change 11
11
import org .springframework .beans .factory .annotation .Autowired ;
12
12
import org .springframework .boot .test .autoconfigure .web .reactive .AutoConfigureWebTestClient ;
13
13
import org .springframework .test .context .ActiveProfiles ;
14
+ import org .springframework .test .context .TestPropertySource ;
14
15
import org .springframework .test .web .reactive .server .WebTestClient ;
15
16
16
17
@ AutoConfigureWebTestClient (timeout = "3600000" )
17
18
@ ActiveProfiles ("test" )
19
+ @ TestPropertySource (properties = "springdoc.api-docs.version=openapi_3_0" )
18
20
public abstract class AbstractCommonTest {
19
21
20
22
protected static final Logger LOGGER = LoggerFactory .getLogger (AbstractCommonTest .class );
Original file line number Diff line number Diff line change 12
12
import org .springframework .beans .factory .annotation .Autowired ;
13
13
import org .springframework .boot .test .autoconfigure .web .reactive .AutoConfigureWebTestClient ;
14
14
import org .springframework .test .context .ActiveProfiles ;
15
+ import org .springframework .test .context .TestPropertySource ;
15
16
import org .springframework .test .web .reactive .server .WebTestClient ;
16
17
17
18
@ AutoConfigureWebTestClient (timeout = "3600000" )
18
19
@ ActiveProfiles ("test" )
20
+ @ TestPropertySource (properties = "springdoc.api-docs.version=openapi_3_0" )
19
21
public abstract class AbstractCommonTest {
20
22
21
23
protected static final Logger LOGGER = LoggerFactory .getLogger (AbstractCommonTest .class );
Original file line number Diff line number Diff line change 29
29
import test .org .springdoc .api .AbstractCommonTest ;
30
30
31
31
import org .springframework .boot .test .context .SpringBootTest ;
32
+ import org .springframework .test .context .TestPropertySource ;
32
33
import org .springframework .test .web .servlet .MvcResult ;
33
34
34
35
import static org .hamcrest .Matchers .is ;
38
39
import static org .springframework .test .web .servlet .result .MockMvcResultMatchers .status ;
39
40
40
41
@ SpringBootTest
42
+ @ TestPropertySource (properties = { "springdoc.api-docs.version=openapi_3_0" })
41
43
public abstract class AbstractSpringDocV30Test extends AbstractCommonTest {
42
44
43
45
public static String className ;
Original file line number Diff line number Diff line change 52
52
/**
53
53
* Tests deterministic creation of operationIds
54
54
*/
55
- @ SpringBootTest (properties = { SPRINGDOC_CACHE_DISABLED + "=true" })
55
+ @ SpringBootTest (properties = { SPRINGDOC_CACHE_DISABLED + "=true" , "springdoc.api-docs.version=openapi_3_0" })
56
56
public class SpringDocApp136Test extends AbstractCommonTest {
57
57
58
58
@ Autowired
Original file line number Diff line number Diff line change 39
39
import static org .springframework .test .web .servlet .result .MockMvcResultMatchers .jsonPath ;
40
40
import static org .springframework .test .web .servlet .result .MockMvcResultMatchers .status ;
41
41
42
- @ SpringBootTest
42
+ @ SpringBootTest ( properties = { "springdoc.api-docs.version=openapi_3_0" })
43
43
public class SpringDocApp193Test extends AbstractCommonTest {
44
44
45
45
@ Test
Original file line number Diff line number Diff line change 56
56
57
57
@ SpringBootTest (properties = {
58
58
"springdoc.pre-loading-enabled=true" ,
59
- "springdoc.pre-loading-locales=ja"
59
+ "springdoc.pre-loading-locales=ja" ,
60
+ "springdoc.api-docs.version=openapi_3_0"
60
61
})
61
62
public class SpringDocApp209Test extends AbstractCommonTest {
62
63
public static String className ;
Original file line number Diff line number Diff line change 39
39
import static org .springframework .test .web .servlet .result .MockMvcResultMatchers .status ;
40
40
41
41
@ SpringBootTest
42
- @ TestPropertySource (properties = { "springdoc.api-docs.version=openapi_3_1" })
43
42
public abstract class AbstractSpringDocV31Test extends AbstractCommonTest {
44
43
45
44
public static String className ;
Original file line number Diff line number Diff line change 9
9
import org .springframework .beans .factory .annotation .Autowired ;
10
10
import org .springframework .boot .test .autoconfigure .web .servlet .AutoConfigureMockMvc ;
11
11
import org .springframework .test .context .ActiveProfiles ;
12
+ import org .springframework .test .context .TestPropertySource ;
12
13
import org .springframework .test .web .servlet .MockMvc ;
13
14
14
15
@ AutoConfigureMockMvc
15
16
@ ActiveProfiles ("test" )
17
+ @ TestPropertySource (properties = "springdoc.api-docs.version=openapi_3_0" )
16
18
public abstract class AbstractCommonTest {
17
19
18
20
@ Autowired
Original file line number Diff line number Diff line change 20
20
21
21
@ AutoConfigureWebTestClient (timeout = "3600000" )
22
22
@ ActiveProfiles ("test" )
23
- @ TestPropertySource (properties = { "management.endpoints.enabled-by-default=false" })
23
+ @ TestPropertySource (properties = { "management.endpoints.enabled-by-default=false" , "springdoc.api-docs.version=openapi_3_0" })
24
24
public abstract class AbstractCommonTest {
25
25
26
26
protected static final Logger LOGGER = LoggerFactory .getLogger (AbstractCommonTest .class );
Original file line number Diff line number Diff line change 13
13
14
14
@ AutoConfigureMockMvc
15
15
@ ActiveProfiles ("test" )
16
- @ TestPropertySource (properties = { "management.endpoints.enabled-by-default=false" })
16
+ @ TestPropertySource (properties = { "management.endpoints.enabled-by-default=false" , "springdoc.api-docs.version=openapi_3_0" })
17
17
public abstract class AbstractCommonTest {
18
18
19
19
@ Autowired
Original file line number Diff line number Diff line change 24
24
import java .nio .file .Paths ;
25
25
26
26
import org .junit .jupiter .api .Test ;
27
- import org .slf4j .Logger ;
28
- import org .slf4j .LoggerFactory ;
29
27
import org .springdoc .core .utils .Constants ;
30
28
31
29
import org .springframework .beans .factory .annotation .Autowired ;
32
30
import org .springframework .boot .test .autoconfigure .web .servlet .AutoConfigureMockMvc ;
33
31
import org .springframework .boot .test .context .SpringBootTest ;
34
32
import org .springframework .test .context .ActiveProfiles ;
33
+ import org .springframework .test .context .TestPropertySource ;
35
34
import org .springframework .test .web .servlet .MockMvc ;
36
35
import org .springframework .test .web .servlet .MvcResult ;
37
36
44
43
@ ActiveProfiles ("test" )
45
44
@ SpringBootTest
46
45
@ AutoConfigureMockMvc
46
+ @ TestPropertySource (properties = "springdoc.api-docs.version=openapi_3_0" )
47
47
public abstract class AbstractSpringDocTest {
48
48
49
- protected static final Logger LOGGER = LoggerFactory .getLogger (AbstractSpringDocTest .class );
50
-
51
49
public static String className ;
52
50
53
51
@ Autowired
Original file line number Diff line number Diff line change 11
11
import org .springframework .beans .factory .annotation .Autowired ;
12
12
import org .springframework .boot .test .autoconfigure .web .reactive .AutoConfigureWebTestClient ;
13
13
import org .springframework .test .context .ActiveProfiles ;
14
+ import org .springframework .test .context .TestPropertySource ;
14
15
import org .springframework .test .web .reactive .server .WebTestClient ;
15
16
16
17
@ AutoConfigureWebTestClient (timeout = "3600000" )
17
18
@ ActiveProfiles ("test" )
19
+ @ TestPropertySource (properties = "springdoc.api-docs.version=openapi_3_0" )
18
20
public abstract class AbstractCommonTest {
19
21
20
22
protected static final Logger LOGGER = LoggerFactory .getLogger (AbstractCommonTest .class );
Original file line number Diff line number Diff line change 8
8
import org .springframework .beans .factory .annotation .Autowired ;
9
9
import org .springframework .boot .test .autoconfigure .web .servlet .AutoConfigureMockMvc ;
10
10
import org .springframework .test .context .ActiveProfiles ;
11
+ import org .springframework .test .context .TestPropertySource ;
11
12
import org .springframework .test .web .servlet .MockMvc ;
12
13
13
14
@ AutoConfigureMockMvc
14
15
@ ActiveProfiles ("test" )
16
+ @ TestPropertySource (properties = "springdoc.api-docs.version=openapi_3_0" )
15
17
public abstract class AbstractCommonTest {
16
18
17
19
@ Autowired
Original file line number Diff line number Diff line change 32
32
import org .springframework .boot .test .autoconfigure .web .servlet .AutoConfigureMockMvc ;
33
33
import org .springframework .boot .test .context .SpringBootTest ;
34
34
import org .springframework .test .context .ActiveProfiles ;
35
+ import org .springframework .test .context .TestPropertySource ;
35
36
import org .springframework .test .web .servlet .MockMvc ;
36
37
import org .springframework .test .web .servlet .MvcResult ;
37
38
44
45
@ ActiveProfiles ("test" )
45
46
@ SpringBootTest
46
47
@ AutoConfigureMockMvc
48
+ @ TestPropertySource (properties = "springdoc.api-docs.version=openapi_3_0" )
47
49
public abstract class AbstractSpringDocTest {
48
50
49
51
protected static final Logger LOGGER = LoggerFactory .getLogger (AbstractSpringDocTest .class );
Original file line number Diff line number Diff line change 36
36
import org .springframework .boot .test .autoconfigure .web .servlet .AutoConfigureMockMvc ;
37
37
import org .springframework .boot .test .context .SpringBootTest ;
38
38
import org .springframework .test .context .ActiveProfiles ;
39
+ import org .springframework .test .context .TestPropertySource ;
39
40
import org .springframework .test .web .servlet .MockMvc ;
40
41
import org .springframework .test .web .servlet .MvcResult ;
41
42
48
49
@ ActiveProfiles ("test" )
49
50
@ SpringBootTest
50
51
@ AutoConfigureMockMvc
52
+ @ TestPropertySource (properties = "springdoc.api-docs.version=openapi_3_0" )
51
53
public abstract class AbstractSpringDocTest {
52
54
53
55
public static String className ;
Original file line number Diff line number Diff line change 32
32
import org .springframework .boot .test .autoconfigure .web .servlet .AutoConfigureMockMvc ;
33
33
import org .springframework .boot .test .context .SpringBootTest ;
34
34
import org .springframework .test .context .ActiveProfiles ;
35
+ import org .springframework .test .context .TestPropertySource ;
35
36
import org .springframework .test .web .servlet .MockMvc ;
36
37
import org .springframework .test .web .servlet .MvcResult ;
37
38
47
48
@ ActiveProfiles ("test" )
48
49
@ SpringBootTest
49
50
@ AutoConfigureMockMvc
51
+ @ TestPropertySource (properties = "springdoc.api-docs.version=openapi_3_0" )
50
52
public abstract class AbstractSpringDocTest {
51
53
52
54
/**
Original file line number Diff line number Diff line change 31
31
import org .springframework .beans .factory .annotation .Autowired ;
32
32
import org .springframework .boot .test .autoconfigure .web .reactive .WebFluxTest ;
33
33
import org .springframework .test .context .ActiveProfiles ;
34
+ import org .springframework .test .context .TestPropertySource ;
34
35
import org .springframework .test .web .reactive .server .EntityExchangeResult ;
35
36
import org .springframework .test .web .reactive .server .WebTestClient ;
36
37
37
38
import static org .skyscreamer .jsonassert .JSONAssert .assertEquals ;
38
39
39
40
@ WebFluxTest
40
41
@ ActiveProfiles ("test" )
42
+ @ TestPropertySource (properties = "springdoc.api-docs.version=openapi_3_0" )
41
43
public abstract class AbstractSpringDocTest {
42
44
43
45
protected static final Logger LOGGER = LoggerFactory .getLogger (AbstractSpringDocTest .class );
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired
26
26
import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient
27
27
import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest
28
28
import org.springframework.test.context.ActiveProfiles
29
+ import org.springframework.test.context.TestPropertySource
29
30
import org.springframework.test.web.reactive.server.WebTestClient
30
31
import java.nio.charset.StandardCharsets
31
32
import java.nio.file.Files
@@ -34,6 +35,7 @@ import java.nio.file.Paths
34
35
@WebFluxTest
35
36
@ActiveProfiles(" test" )
36
37
@AutoConfigureWebTestClient(timeout = " 3600000" )
38
+ @TestPropertySource(properties = [" springdoc.api-docs.version=openapi_3_0" ])
37
39
abstract class AbstractKotlinSpringDocTest {
38
40
39
41
@Autowired
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired
25
25
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc
26
26
import org.springframework.boot.test.context.SpringBootTest
27
27
import org.springframework.test.context.ActiveProfiles
28
+ import org.springframework.test.context.TestPropertySource
28
29
import org.springframework.test.web.servlet.MockMvc
29
30
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders
30
31
import org.springframework.test.web.servlet.result.MockMvcResultMatchers
@@ -35,6 +36,7 @@ import java.nio.file.Paths
35
36
@SpringBootTest
36
37
@AutoConfigureMockMvc
37
38
@ActiveProfiles(" test" )
39
+ @TestPropertySource(properties = [" springdoc.api-docs.version=openapi_3_0" ])
38
40
abstract class AbstractKotlinSpringDocMVCTest {
39
41
40
42
@Autowired
Original file line number Diff line number Diff line change @@ -21,23 +21,15 @@ package test.org.springdoc.api.app13
21
21
import org.springdoc.core.properties.SpringDocConfigProperties
22
22
import org.springdoc.core.properties.SpringDocConfigProperties.ApiDocs.OpenApiVersion
23
23
import org.springframework.boot.autoconfigure.SpringBootApplication
24
- import org.springframework.boot.test.context.SpringBootTest
25
24
import org.springframework.context.annotation.Bean
26
- import org.springframework.context.annotation.ComponentScan
27
- import org.springframework.context.annotation.Configuration
25
+ import org.springframework.test.context.TestPropertySource
28
26
import test.org.springdoc.api.AbstractKotlinSpringDocMVCTest
29
27
30
-
28
+ @TestPropertySource(properties = [ " springdoc.api-docs.version=openapi_3_1 " ])
31
29
class SpringDocApp13Test : AbstractKotlinSpringDocMVCTest () {
32
30
33
31
@SpringBootApplication
34
32
class DemoApplication {
35
- @Bean
36
- fun springDocConfigProperties ():SpringDocConfigProperties {
37
- val x= SpringDocConfigProperties ()
38
- x.apiDocs.version = OpenApiVersion .OPENAPI_3_1
39
- return x
40
- }
41
33
}
42
34
43
35
Original file line number Diff line number Diff line change 33
33
import org .springframework .boot .test .context .SpringBootTest ;
34
34
import org .springframework .context .annotation .Configuration ;
35
35
import org .springframework .test .context .ActiveProfiles ;
36
+ import org .springframework .test .context .TestPropertySource ;
36
37
import org .springframework .test .web .servlet .MockMvc ;
37
38
import org .springframework .test .web .servlet .MvcResult ;
38
39
45
46
@ ActiveProfiles ("test" )
46
47
@ SpringBootTest
47
48
@ AutoConfigureMockMvc
49
+ @ TestPropertySource (properties = "springdoc.api-docs.version=openapi_3_0" )
48
50
public abstract class AbstractSpringDocTest {
49
51
50
52
public static String className ;
You can’t perform that action at this time.
0 commit comments