File tree 3 files changed +44
-7
lines changed
springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test
kotlin/test/org/springdoc/api/app13
3 files changed +44
-7
lines changed Original file line number Diff line number Diff line change 18
18
19
19
package test.org.springdoc.api.app13
20
20
21
+ import org.springdoc.core.properties.SpringDocConfigProperties
22
+ import org.springdoc.core.properties.SpringDocConfigProperties.ApiDocs.OpenApiVersion
21
23
import org.springframework.boot.autoconfigure.SpringBootApplication
24
+ import org.springframework.boot.test.context.SpringBootTest
25
+ import org.springframework.context.annotation.Bean
26
+ import org.springframework.context.annotation.Configuration
22
27
import test.org.springdoc.api.AbstractKotlinSpringDocMVCTest
23
28
29
+
30
+ @SpringBootTest// (classes = [Config::class])
24
31
class SpringDocApp13Test : AbstractKotlinSpringDocMVCTest () {
25
32
33
+
34
+ @Configuration
35
+ class Config {
36
+ @Bean
37
+ fun springDocConfigProperties ():SpringDocConfigProperties {
38
+ val x= SpringDocConfigProperties ()
39
+ x.apiDocs.version = OpenApiVersion .OPENAPI_3_1
40
+ return x
41
+ }
42
+
43
+ }
44
+
45
+
26
46
@SpringBootApplication
27
47
class DemoApplication
28
48
Original file line number Diff line number Diff line change 19
19
package test.org.springdoc.api.app13
20
20
21
21
22
+ import io.swagger.v3.oas.annotations.OpenAPI31
22
23
import io.swagger.v3.oas.annotations.media.Schema
23
24
import org.springframework.web.bind.annotation.PostMapping
24
25
import org.springframework.web.bind.annotation.RequestBody
@@ -38,6 +39,7 @@ data class SomeDTO(
38
39
)
39
40
40
41
42
+
41
43
@RestController
42
44
@RequestMapping(" /test" )
43
45
class TestController {
Original file line number Diff line number Diff line change 52
52
} ]
53
53
},
54
54
"SomeDTO" : {
55
- "required" : [ " fieldA" , " fieldB" ],
56
- "type" : " object" ,
57
- "properties" : {
58
- "fieldA" : {
59
- "$ref" : " #/components/schemas/KeyValue"
55
+ "required" : [
56
+ " fieldA" ,
57
+ " fieldB"
58
+ ],
59
+ "type" : " object" ,
60
+ "properties" : {
61
+ "fieldA" : {
62
+ "type" : " object" ,
63
+ "description" : " Description A" ,
64
+ "allOf" : [
65
+ {
66
+ "$ref" : " #/components/schemas/KeyValue"
67
+ }
68
+ ]
60
69
},
61
- "fieldB" : {
62
- "$ref" : " #/components/schemas/KeyValue"
70
+ "fieldB" : {
71
+ "type" : " object" ,
72
+ "description" : " Description B" ,
73
+ "allOf" : [
74
+ {
75
+ "$ref" : " #/components/schemas/KeyValue"
76
+ }
77
+ ]
63
78
}
64
79
}
65
80
}
You can’t perform that action at this time.
0 commit comments