File tree 14 files changed +59
-62
lines changed
Sources/OpenAPIKit/Document
OpenAPIKitErrorReportingTests
14 files changed +59
-62
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ extension OpenAPI {
142
142
public var vendorExtensions : [ String : AnyCodable ]
143
143
144
144
public init (
145
- openAPIVersion: Version = . v3_0_0 ,
145
+ openAPIVersion: Version = . v3_1_0 ,
146
146
info: Info ,
147
147
servers: [ Server ] ,
148
148
paths: PathItem . Map ,
@@ -361,10 +361,7 @@ extension OpenAPI.Document {
361
361
/// this enum. Other versions may or may not be decodable by
362
362
/// OpenAPIKit to a certain extent.
363
363
public enum Version : String , Codable {
364
- case v3_0_0 = " 3.0.0 "
365
- case v3_0_1 = " 3.0.1 "
366
- case v3_0_2 = " 3.0.2 "
367
- case v3_0_3 = " 3.0.3 "
364
+ case v3_1_0 = " 3.1.0 "
368
365
}
369
366
}
370
367
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ final class ComponentErrorTests: XCTestCase {
15
15
func test_badComponentKeyNames( ) {
16
16
let documentYML =
17
17
"""
18
- openapi: " 3.0 .0 "
18
+ openapi: " 3.1 .0 "
19
19
info:
20
20
title: test
21
21
version: 1.0
@@ -38,7 +38,7 @@ final class ComponentErrorTests: XCTestCase {
38
38
func test_badResponseBecauseOfHeaderInsideComponents( ) {
39
39
let documentYML =
40
40
"""
41
- openapi: " 3.0 .0 "
41
+ openapi: " 3.1 .0 "
42
42
info:
43
43
title: test
44
44
version: 1.0
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ final class DocumentErrorTests: XCTestCase {
92
92
func test_missingInfo( ) {
93
93
let documentYML =
94
94
"""
95
- openapi: " 3.0 .0 "
95
+ openapi: " 3.1 .0 "
96
96
paths: {}
97
97
"""
98
98
@@ -108,7 +108,7 @@ final class DocumentErrorTests: XCTestCase {
108
108
func test_wrongTypesInfo( ) {
109
109
let documentYML =
110
110
"""
111
- openapi: " 3.0 .0 "
111
+ openapi: " 3.1 .0 "
112
112
info: null
113
113
paths: {}
114
114
"""
@@ -125,7 +125,7 @@ final class DocumentErrorTests: XCTestCase {
125
125
126
126
let documentYML2 =
127
127
"""
128
- openapi: " 3.0 .0 "
128
+ openapi: " 3.1 .0 "
129
129
info: []
130
130
paths: {}
131
131
"""
@@ -144,7 +144,7 @@ final class DocumentErrorTests: XCTestCase {
144
144
func test_missingTitleInsideInfo( ) {
145
145
let documentYML =
146
146
"""
147
- openapi: " 3.0 .0 "
147
+ openapi: " 3.1 .0 "
148
148
info: {}
149
149
paths: {}
150
150
"""
@@ -163,7 +163,7 @@ final class DocumentErrorTests: XCTestCase {
163
163
func test_missingNameInsideSecondTag( ) {
164
164
let documentYML =
165
165
"""
166
- openapi: " 3.0 .0 "
166
+ openapi: " 3.1 .0 "
167
167
info:
168
168
title: test
169
169
version: 1.0
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ final class JSONReferenceErrorTests: XCTestCase {
14
14
func test_referenceFailedToParse( ) {
15
15
let documentYML =
16
16
"""
17
- openapi: " 3.0 .0 "
17
+ openapi: " 3.1 .0 "
18
18
info:
19
19
title: test
20
20
version: 1.0
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ final class OperationErrorTests: XCTestCase {
14
14
func test_missingResponses( ) {
15
15
let documentYML =
16
16
"""
17
- openapi: " 3.0 .0 "
17
+ openapi: " 3.1 .0 "
18
18
info:
19
19
title: test
20
20
version: 1.0
@@ -39,7 +39,7 @@ final class OperationErrorTests: XCTestCase {
39
39
func test_wrongTypeTags( ) {
40
40
let documentYML =
41
41
"""
42
- openapi: " 3.0 .0 "
42
+ openapi: " 3.1 .0 "
43
43
info:
44
44
title: test
45
45
version: 1.0
@@ -67,7 +67,7 @@ final class OperationErrorTests: XCTestCase {
67
67
func test_missingUrlInServer( ) {
68
68
let documentYML =
69
69
"""
70
- openapi: " 3.0 .0 "
70
+ openapi: " 3.1 .0 "
71
71
info:
72
72
title: test
73
73
version: 1.0
@@ -101,7 +101,7 @@ extension OperationErrorTests {
101
101
func test_missingResponseFromSSWGPitchConversation( ) {
102
102
let documentYML =
103
103
"""
104
- openapi: 3.0 .0
104
+ openapi: 3.1 .0
105
105
info:
106
106
title: API
107
107
version: 1.0.0
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ final class PathsErrorTests: XCTestCase {
14
14
func test_missingPaths( ) {
15
15
let documentYML =
16
16
"""
17
- openapi: " 3.0 .0 "
17
+ openapi: " 3.1 .0 "
18
18
info:
19
19
title: test
20
20
version: 1.0
@@ -32,7 +32,7 @@ final class PathsErrorTests: XCTestCase {
32
32
func test_wrongTypeParameter( ) {
33
33
let documentYML =
34
34
"""
35
- openapi: " 3.0 .0 "
35
+ openapi: " 3.1 .0 "
36
36
info:
37
37
title: test
38
38
version: 1.0
@@ -58,7 +58,7 @@ final class PathsErrorTests: XCTestCase {
58
58
59
59
let documentYML2 =
60
60
"""
61
- openapi: " 3.0 .0 "
61
+ openapi: " 3.1 .0 "
62
62
info:
63
63
title: test
64
64
version: 1.0
@@ -86,7 +86,7 @@ final class PathsErrorTests: XCTestCase {
86
86
func test_optionalPositionalPathParam( ) {
87
87
let documentYML =
88
88
"""
89
- openapi: " 3.0 .0 "
89
+ openapi: " 3.1 .0 "
90
90
info:
91
91
title: test
92
92
version: 1.0
@@ -121,7 +121,7 @@ final class PathsErrorTests: XCTestCase {
121
121
func test_noContentOrSchemaParam( ) {
122
122
let documentYML =
123
123
"""
124
- openapi: " 3.0 .0 "
124
+ openapi: " 3.1 .0 "
125
125
info:
126
126
title: test
127
127
version: 1.0
@@ -154,7 +154,7 @@ final class PathsErrorTests: XCTestCase {
154
154
func test_bothContentAndSchemaParam( ) {
155
155
let documentYML =
156
156
"""
157
- openapi: " 3.0 .0 "
157
+ openapi: " 3.1 .0 "
158
158
info:
159
159
title: test
160
160
version: 1.0
@@ -193,7 +193,7 @@ final class PathsErrorTests: XCTestCase {
193
193
func test_paramSchemaHasProblemDeeplyNestedInSchema( ) {
194
194
let documentYML =
195
195
"""
196
- openapi: " 3.0 .0 "
196
+ openapi: " 3.1 .0 "
197
197
info:
198
198
title: test
199
199
version: 1.0
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ final class RequestContentMapErrorTests: XCTestCase {
22
22
// func test_wrongTypeContentMapKey() {
23
23
// let documentYML =
24
24
//"""
25
- //openapi: "3.0 .0"
25
+ //openapi: "3.1 .0"
26
26
//info:
27
27
// title: test
28
28
// version: 1.0
@@ -54,7 +54,7 @@ final class RequestContentMapErrorTests: XCTestCase {
54
54
func test_wrongTypeContentValue( ) {
55
55
let documentYML =
56
56
"""
57
- openapi: " 3.0 .0 "
57
+ openapi: " 3.1 .0 "
58
58
info:
59
59
title: test
60
60
version: 1.0
@@ -86,7 +86,7 @@ final class RequestContentMapErrorTests: XCTestCase {
86
86
func test_incorrectVendorExtension( ) {
87
87
let documentYML =
88
88
"""
89
- openapi: " 3.0 .0 "
89
+ openapi: " 3.1 .0 "
90
90
info:
91
91
title: test
92
92
version: 1.0
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ final class RequestContentSchemaErrorTests: XCTestCase {
14
14
func test_wrongTypeContentSchemaTypeProperty( ) {
15
15
let documentYML =
16
16
"""
17
- openapi: " 3.0 .0 "
17
+ openapi: " 3.1 .0 "
18
18
info:
19
19
title: test
20
20
version: 1.0
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ final class RequestErrorTests: XCTestCase {
14
14
func test_wrongTypeRequest( ) {
15
15
let documentYML =
16
16
"""
17
- openapi: " 3.0 .0 "
17
+ openapi: " 3.1 .0 "
18
18
info:
19
19
title: test
20
20
version: 1.0
@@ -42,7 +42,7 @@ final class RequestErrorTests: XCTestCase {
42
42
func test_missingContentMap( ) {
43
43
let documentYML =
44
44
"""
45
- openapi: " 3.0 .0 "
45
+ openapi: " 3.1 .0 "
46
46
info:
47
47
title: test
48
48
version: 1.0
@@ -71,7 +71,7 @@ final class RequestErrorTests: XCTestCase {
71
71
func test_wrongTypeContentMap( ) {
72
72
let documentYML =
73
73
"""
74
- openapi: " 3.0 .0 "
74
+ openapi: " 3.1 .0 "
75
75
info:
76
76
title: test
77
77
version: 1.0
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ final class ResponseErrorTests: XCTestCase {
14
14
func test_headerWithContentAndSchema( ) {
15
15
let documentYML =
16
16
"""
17
- openapi: " 3.0 .0 "
17
+ openapi: " 3.1 .0 "
18
18
info:
19
19
title: test
20
20
version: 1.0
@@ -62,7 +62,7 @@ final class ResponseErrorTests: XCTestCase {
62
62
// func test_badStatusCode() {
63
63
// let documentYML =
64
64
//"""
65
- //openapi: "3.0 .0"
65
+ //openapi: "3.1 .0"
66
66
//info:
67
67
// title: test
68
68
// version: 1.0
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ final class SecuritySchemeErrorTests: XCTestCase {
15
15
// missing as-in not found in the Components Object
16
16
let documentYML =
17
17
"""
18
- openapi: 3.0 .0
18
+ openapi: 3.1 .0
19
19
info:
20
20
title: test
21
21
version: 1.0
@@ -40,7 +40,7 @@ final class SecuritySchemeErrorTests: XCTestCase {
40
40
// missing as-in not found in the Components Object
41
41
let documentYML =
42
42
"""
43
- openapi: 3.0 .0
43
+ openapi: 3.1 .0
44
44
info:
45
45
title: test
46
46
version: 1.0
You can’t perform that action at this time.
0 commit comments