Skip to content

Commit c0c48e1

Browse files
committed
Add support for OpenAPI 3.0.4 and 3.1.1
1 parent 7b4dd6b commit c0c48e1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Sources/_OpenAPIGeneratorCore/Parser/YamsParser.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ public struct YamsParser: ParserProtocol {
7070
do {
7171
let document: OpenAPIKit.OpenAPI.Document
7272
switch openAPIVersion {
73-
case "3.0.0", "3.0.1", "3.0.2", "3.0.3":
73+
case "3.0.0", "3.0.1", "3.0.2", "3.0.3", "3.0.4":
7474
let openAPI30Document = try decoder.decode(OpenAPIKit30.OpenAPI.Document.self, from: input.contents)
7575
document = openAPI30Document.convert(to: .v3_1_0)
76-
case "3.1.0": document = try decoder.decode(OpenAPIKit.OpenAPI.Document.self, from: input.contents)
76+
case "3.1.0", "3.1.1": document = try decoder.decode(OpenAPIKit.OpenAPI.Document.self, from: input.contents)
7777
default:
7878
throw Diagnostic.openAPIVersionError(
7979
versionString: "openapi: \(openAPIVersion)",

Tests/OpenAPIGeneratorCoreTests/Parser/Test_YamsParser.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ final class Test_YamsParser: Test_Core {
2121
XCTAssertNoThrow(try _test(openAPIVersionString: "3.0.1"))
2222
XCTAssertNoThrow(try _test(openAPIVersionString: "3.0.2"))
2323
XCTAssertNoThrow(try _test(openAPIVersionString: "3.0.3"))
24+
XCTAssertNoThrow(try _test(openAPIVersionString: "3.0.4"))
2425
XCTAssertNoThrow(try _test(openAPIVersionString: "3.1.0"))
26+
XCTAssertNoThrow(try _test(openAPIVersionString: "3.1.1"))
2527

2628
let expected1 =
2729
"/foo.yaml: error: Unsupported document version: openapi: 3.2.0. Please provide a document with OpenAPI versions in the 3.0.x or 3.1.x sets."

0 commit comments

Comments
 (0)