From ce2a53a465cf83e6b009bd3b067f22adc76d1c01 Mon Sep 17 00:00:00 2001 From: Brandon Bloom Date: Sun, 31 Mar 2024 12:28:21 -0500 Subject: [PATCH] Raise minimum Yams version. Fixes #364 --- Package.resolved | 4 ++-- Package.swift | 2 +- .../Schema Object/SchemaObjectYamsTests.swift | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Package.resolved b/Package.resolved index ac2140923..8ea187bda 100644 --- a/Package.resolved +++ b/Package.resolved @@ -23,8 +23,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/jpsim/Yams.git", "state" : { - "revision" : "9ff1cc9327586db4e0c8f46f064b6a82ec1566fa", - "version" : "4.0.6" + "revision" : "8a835d918245ca22f36663dd3862138805d7f707", + "version" : "5.1.0" } } ], diff --git a/Package.swift b/Package.swift index 8402adb61..03e1cfd05 100644 --- a/Package.swift +++ b/Package.swift @@ -21,7 +21,7 @@ let package = Package( ], dependencies: [ .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"), - .package(url: "https://github.com/jpsim/Yams.git", "4.0.0"..<"6.0.0") // just for tests + .package(url: "https://github.com/jpsim/Yams.git", "5.1.0"..<"6.0.0") // just for tests ], targets: [ .target( diff --git a/Tests/OpenAPIKitTests/Schema Object/SchemaObjectYamsTests.swift b/Tests/OpenAPIKitTests/Schema Object/SchemaObjectYamsTests.swift index 12c7c10cd..1d32f5d72 100644 --- a/Tests/OpenAPIKitTests/Schema Object/SchemaObjectYamsTests.swift +++ b/Tests/OpenAPIKitTests/Schema Object/SchemaObjectYamsTests.swift @@ -16,6 +16,20 @@ import OpenAPIKit import Yams final class SchemaObjectYamsTests: XCTestCase { + func test_nullTypeDecode() throws { + let nullString = + """ + type: 'null' + """ + + let null = try YAMLDecoder().decode(JSONSchema.self, from: nullString) + + XCTAssertEqual( + null, + JSONSchema.null() + ) + } + func test_floatingPointWholeNumberIntegerDecode() throws { let integerString = """