File tree Expand file tree Collapse 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 Expand file tree Collapse file tree 3 files changed +44
-7
lines changed Original file line number Diff line number Diff line change 1818
1919package test.org.springdoc.api.app13
2020
21+ import org.springdoc.core.properties.SpringDocConfigProperties
22+ import org.springdoc.core.properties.SpringDocConfigProperties.ApiDocs.OpenApiVersion
2123import 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
2227import test.org.springdoc.api.AbstractKotlinSpringDocMVCTest
2328
29+
30+ @SpringBootTest// (classes = [Config::class])
2431class SpringDocApp13Test : AbstractKotlinSpringDocMVCTest () {
2532
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+
2646 @SpringBootApplication
2747 class DemoApplication
2848
Original file line number Diff line number Diff line change 1919package test.org.springdoc.api.app13
2020
2121
22+ import io.swagger.v3.oas.annotations.OpenAPI31
2223import io.swagger.v3.oas.annotations.media.Schema
2324import org.springframework.web.bind.annotation.PostMapping
2425import org.springframework.web.bind.annotation.RequestBody
@@ -38,6 +39,7 @@ data class SomeDTO(
3839)
3940
4041
42+
4143@RestController
4244@RequestMapping(" /test" )
4345class TestController {
Original file line number Diff line number Diff line change 5252 } ]
5353 },
5454 "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+ ]
6069 },
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+ ]
6378 }
6479 }
6580 }
You can’t perform that action at this time.
0 commit comments