Skip to content

Commit e547a1d

Browse files
authored
Merge pull request #222 from mattpolzin/spec-versions
update OpenAPI spec versions
2 parents 64568bf + 4fc072b commit e547a1d

14 files changed

+59
-62
lines changed

Sources/OpenAPIKit/Document/Document.swift

+2-5
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ extension OpenAPI {
142142
public var vendorExtensions: [String: AnyCodable]
143143

144144
public init(
145-
openAPIVersion: Version = .v3_0_0,
145+
openAPIVersion: Version = .v3_1_0,
146146
info: Info,
147147
servers: [Server],
148148
paths: PathItem.Map,
@@ -361,10 +361,7 @@ extension OpenAPI.Document {
361361
/// this enum. Other versions may or may not be decodable by
362362
/// OpenAPIKit to a certain extent.
363363
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"
368365
}
369366
}
370367

Tests/OpenAPIKitErrorReportingTests/ComponentErrorTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ final class ComponentErrorTests: XCTestCase {
1515
func test_badComponentKeyNames() {
1616
let documentYML =
1717
"""
18-
openapi: "3.0.0"
18+
openapi: "3.1.0"
1919
info:
2020
title: test
2121
version: 1.0
@@ -38,7 +38,7 @@ final class ComponentErrorTests: XCTestCase {
3838
func test_badResponseBecauseOfHeaderInsideComponents() {
3939
let documentYML =
4040
"""
41-
openapi: "3.0.0"
41+
openapi: "3.1.0"
4242
info:
4343
title: test
4444
version: 1.0

Tests/OpenAPIKitErrorReportingTests/DocumentErrorTests.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ final class DocumentErrorTests: XCTestCase {
9292
func test_missingInfo() {
9393
let documentYML =
9494
"""
95-
openapi: "3.0.0"
95+
openapi: "3.1.0"
9696
paths: {}
9797
"""
9898

@@ -108,7 +108,7 @@ final class DocumentErrorTests: XCTestCase {
108108
func test_wrongTypesInfo() {
109109
let documentYML =
110110
"""
111-
openapi: "3.0.0"
111+
openapi: "3.1.0"
112112
info: null
113113
paths: {}
114114
"""
@@ -125,7 +125,7 @@ final class DocumentErrorTests: XCTestCase {
125125

126126
let documentYML2 =
127127
"""
128-
openapi: "3.0.0"
128+
openapi: "3.1.0"
129129
info: []
130130
paths: {}
131131
"""
@@ -144,7 +144,7 @@ final class DocumentErrorTests: XCTestCase {
144144
func test_missingTitleInsideInfo() {
145145
let documentYML =
146146
"""
147-
openapi: "3.0.0"
147+
openapi: "3.1.0"
148148
info: {}
149149
paths: {}
150150
"""
@@ -163,7 +163,7 @@ final class DocumentErrorTests: XCTestCase {
163163
func test_missingNameInsideSecondTag() {
164164
let documentYML =
165165
"""
166-
openapi: "3.0.0"
166+
openapi: "3.1.0"
167167
info:
168168
title: test
169169
version: 1.0

Tests/OpenAPIKitErrorReportingTests/JSONReferenceErrorTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class JSONReferenceErrorTests: XCTestCase {
1414
func test_referenceFailedToParse() {
1515
let documentYML =
1616
"""
17-
openapi: "3.0.0"
17+
openapi: "3.1.0"
1818
info:
1919
title: test
2020
version: 1.0

Tests/OpenAPIKitErrorReportingTests/OperationErrorTests.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class OperationErrorTests: XCTestCase {
1414
func test_missingResponses() {
1515
let documentYML =
1616
"""
17-
openapi: "3.0.0"
17+
openapi: "3.1.0"
1818
info:
1919
title: test
2020
version: 1.0
@@ -39,7 +39,7 @@ final class OperationErrorTests: XCTestCase {
3939
func test_wrongTypeTags() {
4040
let documentYML =
4141
"""
42-
openapi: "3.0.0"
42+
openapi: "3.1.0"
4343
info:
4444
title: test
4545
version: 1.0
@@ -67,7 +67,7 @@ final class OperationErrorTests: XCTestCase {
6767
func test_missingUrlInServer() {
6868
let documentYML =
6969
"""
70-
openapi: "3.0.0"
70+
openapi: "3.1.0"
7171
info:
7272
title: test
7373
version: 1.0
@@ -101,7 +101,7 @@ extension OperationErrorTests {
101101
func test_missingResponseFromSSWGPitchConversation() {
102102
let documentYML =
103103
"""
104-
openapi: 3.0.0
104+
openapi: 3.1.0
105105
info:
106106
title: API
107107
version: 1.0.0

Tests/OpenAPIKitErrorReportingTests/PathsErrorTests.swift

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class PathsErrorTests: XCTestCase {
1414
func test_missingPaths() {
1515
let documentYML =
1616
"""
17-
openapi: "3.0.0"
17+
openapi: "3.1.0"
1818
info:
1919
title: test
2020
version: 1.0
@@ -32,7 +32,7 @@ final class PathsErrorTests: XCTestCase {
3232
func test_wrongTypeParameter() {
3333
let documentYML =
3434
"""
35-
openapi: "3.0.0"
35+
openapi: "3.1.0"
3636
info:
3737
title: test
3838
version: 1.0
@@ -58,7 +58,7 @@ final class PathsErrorTests: XCTestCase {
5858

5959
let documentYML2 =
6060
"""
61-
openapi: "3.0.0"
61+
openapi: "3.1.0"
6262
info:
6363
title: test
6464
version: 1.0
@@ -86,7 +86,7 @@ final class PathsErrorTests: XCTestCase {
8686
func test_optionalPositionalPathParam() {
8787
let documentYML =
8888
"""
89-
openapi: "3.0.0"
89+
openapi: "3.1.0"
9090
info:
9191
title: test
9292
version: 1.0
@@ -121,7 +121,7 @@ final class PathsErrorTests: XCTestCase {
121121
func test_noContentOrSchemaParam() {
122122
let documentYML =
123123
"""
124-
openapi: "3.0.0"
124+
openapi: "3.1.0"
125125
info:
126126
title: test
127127
version: 1.0
@@ -154,7 +154,7 @@ final class PathsErrorTests: XCTestCase {
154154
func test_bothContentAndSchemaParam() {
155155
let documentYML =
156156
"""
157-
openapi: "3.0.0"
157+
openapi: "3.1.0"
158158
info:
159159
title: test
160160
version: 1.0
@@ -193,7 +193,7 @@ final class PathsErrorTests: XCTestCase {
193193
func test_paramSchemaHasProblemDeeplyNestedInSchema() {
194194
let documentYML =
195195
"""
196-
openapi: "3.0.0"
196+
openapi: "3.1.0"
197197
info:
198198
title: test
199199
version: 1.0

Tests/OpenAPIKitErrorReportingTests/RequestContentMapErrorTests.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ final class RequestContentMapErrorTests: XCTestCase {
2222
// func test_wrongTypeContentMapKey() {
2323
// let documentYML =
2424
//"""
25-
//openapi: "3.0.0"
25+
//openapi: "3.1.0"
2626
//info:
2727
// title: test
2828
// version: 1.0
@@ -54,7 +54,7 @@ final class RequestContentMapErrorTests: XCTestCase {
5454
func test_wrongTypeContentValue() {
5555
let documentYML =
5656
"""
57-
openapi: "3.0.0"
57+
openapi: "3.1.0"
5858
info:
5959
title: test
6060
version: 1.0
@@ -86,7 +86,7 @@ final class RequestContentMapErrorTests: XCTestCase {
8686
func test_incorrectVendorExtension() {
8787
let documentYML =
8888
"""
89-
openapi: "3.0.0"
89+
openapi: "3.1.0"
9090
info:
9191
title: test
9292
version: 1.0

Tests/OpenAPIKitErrorReportingTests/RequestContentSchemaErrorTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class RequestContentSchemaErrorTests: XCTestCase {
1414
func test_wrongTypeContentSchemaTypeProperty() {
1515
let documentYML =
1616
"""
17-
openapi: "3.0.0"
17+
openapi: "3.1.0"
1818
info:
1919
title: test
2020
version: 1.0

Tests/OpenAPIKitErrorReportingTests/RequestErrorTests.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class RequestErrorTests: XCTestCase {
1414
func test_wrongTypeRequest() {
1515
let documentYML =
1616
"""
17-
openapi: "3.0.0"
17+
openapi: "3.1.0"
1818
info:
1919
title: test
2020
version: 1.0
@@ -42,7 +42,7 @@ final class RequestErrorTests: XCTestCase {
4242
func test_missingContentMap() {
4343
let documentYML =
4444
"""
45-
openapi: "3.0.0"
45+
openapi: "3.1.0"
4646
info:
4747
title: test
4848
version: 1.0
@@ -71,7 +71,7 @@ final class RequestErrorTests: XCTestCase {
7171
func test_wrongTypeContentMap() {
7272
let documentYML =
7373
"""
74-
openapi: "3.0.0"
74+
openapi: "3.1.0"
7575
info:
7676
title: test
7777
version: 1.0

Tests/OpenAPIKitErrorReportingTests/ResponseErrorTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class ResponseErrorTests: XCTestCase {
1414
func test_headerWithContentAndSchema() {
1515
let documentYML =
1616
"""
17-
openapi: "3.0.0"
17+
openapi: "3.1.0"
1818
info:
1919
title: test
2020
version: 1.0
@@ -62,7 +62,7 @@ final class ResponseErrorTests: XCTestCase {
6262
// func test_badStatusCode() {
6363
// let documentYML =
6464
//"""
65-
//openapi: "3.0.0"
65+
//openapi: "3.1.0"
6666
//info:
6767
// title: test
6868
// version: 1.0

Tests/OpenAPIKitErrorReportingTests/SecuritySchemeErrorTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ final class SecuritySchemeErrorTests: XCTestCase {
1515
// missing as-in not found in the Components Object
1616
let documentYML =
1717
"""
18-
openapi: 3.0.0
18+
openapi: 3.1.0
1919
info:
2020
title: test
2121
version: 1.0
@@ -40,7 +40,7 @@ final class SecuritySchemeErrorTests: XCTestCase {
4040
// missing as-in not found in the Components Object
4141
let documentYML =
4242
"""
43-
openapi: 3.0.0
43+
openapi: 3.1.0
4444
info:
4545
title: test
4646
version: 1.0

0 commit comments

Comments
 (0)