Skip to content

Commit 8f6b049

Browse files
author
m2
committed
add v30 test case
1 parent f57de36 commit 8f6b049

File tree

10 files changed

+49
-47
lines changed

10 files changed

+49
-47
lines changed

springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app15/DemoController.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package test.org.springdoc.api.v31.app15
1+
package test.org.springdoc.api.v30.app15
22

33
import io.swagger.v3.oas.annotations.media.Schema
44
import org.springframework.web.bind.annotation.GetMapping

springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app15/SpringDocApp15Test.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package test.org.springdoc.api.v31.app15
1+
package test.org.springdoc.api.v30.app15
22

33
import org.springframework.boot.autoconfigure.SpringBootApplication
4-
import test.org.springdoc.api.v31.AbstractKotlinSpringDocMVCTest
4+
import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest
55

66
class SpringDocApp15Test : AbstractKotlinSpringDocMVCTest() {
77
@SpringBootApplication

springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app16/DemoController.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package test.org.springdoc.api.v31.app16
1+
package test.org.springdoc.api.v30.app16
22

33
import io.swagger.v3.oas.annotations.media.Schema
44
import org.springframework.web.bind.annotation.GetMapping

springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app16/SpringDocApp16Test.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package test.org.springdoc.api.v31.app16
1+
package test.org.springdoc.api.v30.app16
22

33
import org.springdoc.core.utils.Constants.SPRINGDOC_DEFAULT_FLAT_PARAM_OBJECT
44
import org.springframework.boot.autoconfigure.SpringBootApplication
55
import org.springframework.test.context.TestPropertySource
6-
import test.org.springdoc.api.v31.AbstractKotlinSpringDocMVCTest
6+
import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest
77

88
@TestPropertySource(properties = ["$SPRINGDOC_DEFAULT_FLAT_PARAM_OBJECT=true"])
99
class SpringDocApp16Test : AbstractKotlinSpringDocMVCTest() {

springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app17/DemoController.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package test.org.springdoc.api.v31.app17
1+
package test.org.springdoc.api.v30.app17
22

33
import io.swagger.v3.oas.annotations.media.ArraySchema
44
import io.swagger.v3.oas.annotations.media.Schema

springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v30/app17/SpringDocApp17Test.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package test.org.springdoc.api.v31.app17
1+
package test.org.springdoc.api.v30.app17
22

33
import jakarta.validation.constraints.NotEmpty
44
import org.junit.jupiter.api.Assertions
@@ -9,7 +9,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication
99
import org.springframework.context.annotation.Bean
1010
import org.springframework.core.MethodParameter
1111
import org.springframework.test.context.TestPropertySource
12-
import test.org.springdoc.api.v31.AbstractKotlinSpringDocMVCTest
12+
import test.org.springdoc.api.v30.AbstractKotlinSpringDocMVCTest
1313

1414
@TestPropertySource(properties = ["$SPRINGDOC_DEFAULT_FLAT_PARAM_OBJECT=true"])
1515
class SpringDocApp17Test : AbstractKotlinSpringDocMVCTest() {

springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/kotlin/test/org/springdoc/api/v31/app17/SpringDocApp17Test.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class SpringDocApp17Test : AbstractKotlinSpringDocMVCTest() {
3131
val fieldAnnotations = field.annotations
3232
Assertions.assertTrue(fieldAnnotations.any { it is NotEmpty })
3333
// remove parent field
34-
methodParameters.removeAt(index)
34+
// methodParameters.removeAt(index)
3535
} else fieldNameSet.add(field.name)
3636
}
3737
}

springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app15.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"openapi": "3.1.0",
2+
"openapi": "3.0.1",
33
"info": {
44
"title": "OpenAPI definition",
55
"version": "v0"
@@ -45,6 +45,11 @@
4545
"components": {
4646
"schemas": {
4747
"DemoRequest": {
48+
"required": [
49+
"field10true",
50+
"field11true",
51+
"fieldN0true"
52+
],
4853
"type": "object",
4954
"properties": {
5055
"field11true": {
@@ -65,24 +70,19 @@
6570
"fieldN0true": {
6671
"type": "string"
6772
}
68-
},
69-
"required": [
70-
"field10true",
71-
"field11true",
72-
"fieldN0true"
73-
]
73+
}
7474
},
7575
"DemoDto": {
76+
"required": [
77+
"id"
78+
],
7679
"type": "object",
7780
"properties": {
7881
"id": {
7982
"type": "integer",
8083
"format": "int64"
8184
}
82-
},
83-
"required": [
84-
"id"
85-
]
85+
}
8686
}
8787
}
8888
}

springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app16.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"openapi": "3.1.0",
2+
"openapi": "3.0.1",
33
"info": {
44
"title": "OpenAPI definition",
55
"version": "v0"
@@ -85,16 +85,16 @@
8585
"components": {
8686
"schemas": {
8787
"DemoDto": {
88+
"required": [
89+
"id"
90+
],
8891
"type": "object",
8992
"properties": {
9093
"id": {
9194
"type": "integer",
9295
"format": "int64"
9396
}
94-
},
95-
"required": [
96-
"id"
97-
]
97+
}
9898
}
9999
}
100100
}

springdoc-openapi-tests/springdoc-openapi-kotlin-webmvc-tests/src/test/resources/results/3.0.1/app17.json

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"openapi": "3.1.0",
2+
"openapi": "3.0.1",
33
"info": {
44
"title": "OpenAPI definition",
55
"version": "v0"
@@ -23,31 +23,31 @@
2323
"in": "query",
2424
"required": true,
2525
"schema": {
26+
"maxItems": 21,
27+
"minItems": 11,
2628
"type": "array",
2729
"items": {
28-
"type": "string",
29-
"description": "expect: list[minItems = 11, maxItems = 21] expect: string[minLength = 31, maxLength = 41]",
3030
"maxLength": 41,
31-
"minLength": 31
32-
},
33-
"maxItems": 21,
34-
"minItems": 11
31+
"minLength": 31,
32+
"type": "string",
33+
"description": "expect: list[minItems = 11, maxItems = 21] expect: string[minLength = 31, maxLength = 41]"
34+
}
3535
}
3636
},
3737
{
3838
"name": "barList",
3939
"in": "query",
4040
"required": true,
4141
"schema": {
42+
"maxItems": 22,
43+
"minItems": 12,
4244
"type": "array",
4345
"items": {
44-
"type": "string",
45-
"description": "expect: list[minItems = 12, maxItems = 22] expect: string[minLength = 32, maxLength = 42]",
4646
"maxLength": 42,
47-
"minLength": 32
48-
},
49-
"maxItems": 22,
50-
"minItems": 12
47+
"minLength": 32,
48+
"type": "string",
49+
"description": "expect: list[minItems = 12, maxItems = 22] expect: string[minLength = 32, maxLength = 42]"
50+
}
5151
}
5252
},
5353
{
@@ -56,10 +56,11 @@
5656
"description": "expect: minimum = 2",
5757
"required": true,
5858
"schema": {
59+
"minimum": 2,
60+
"exclusiveMinimum": false,
5961
"type": "integer",
60-
"format": "int64",
6162
"description": "expect: minimum = 2",
62-
"minimum": 2
63+
"format": "int64"
6364
}
6465
},
6566
{
@@ -68,10 +69,11 @@
6869
"description": "expect: minimum = 1",
6970
"required": true,
7071
"schema": {
72+
"minimum": 1.0,
73+
"exclusiveMinimum": false,
7174
"type": "integer",
72-
"format": "int64",
7375
"description": "expect: minimum = 1",
74-
"minimum": 1.0
76+
"format": "int64"
7577
}
7678
}
7779
],
@@ -93,16 +95,16 @@
9395
"components": {
9496
"schemas": {
9597
"DemoDto": {
98+
"required": [
99+
"id"
100+
],
96101
"type": "object",
97102
"properties": {
98103
"id": {
99104
"type": "integer",
100105
"format": "int64"
101106
}
102-
},
103-
"required": [
104-
"id"
105-
]
107+
}
106108
}
107109
}
108110
}

0 commit comments

Comments
 (0)