diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4f21b9a..559ef72 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,24 +13,24 @@ jobs: fail-fast: false matrix: image: - - swift:5.9-focal - - swift:5.9-jammy - - swift:5.10-focal - - swift:5.10-jammy + - swift:6.0-focal + - swift:6.0-jammy + - swift:6.1-focal + - swift:6.1-jammy container: ${{ matrix.image }} steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v5 - name: Run tests run: swift test osx: - runs-on: macOS-13 + runs-on: macOS-15 steps: - name: Select latest available Xcode uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: latest - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v5 - name: Run tests run: swift test diff --git a/Package.resolved b/Package.resolved index ff1391a..7b56a09 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,4 +1,5 @@ { + "originHash" : "58e508d9c3e87af1e13661a8049ff5332d67bffd9ade824f0e04300f6697f615", "pins" : [ { "identity" : "chalk", @@ -23,8 +24,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/mattpolzin/JSONAPI.git", "state" : { - "revision" : "661dfc3ffec1ba3a201fd067877da2f3c553f236", - "version" : "5.1.0" + "revision" : "d3457ae21a76b21e9a8f5bf3953ba9166cfa12f0", + "version" : "6.0.0" } }, { @@ -32,8 +33,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/mattpolzin/JSONAPIViz.git", "state" : { - "revision" : "407422e121c2d73f6dd262071df62481cb4016e9", - "version" : "0.0.6" + "revision" : "129a7d622a8512bd35909b413a4ab7a70ddaac3f", + "version" : "0.0.7" } }, { @@ -41,8 +42,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/mattpolzin/OpenAPIKit.git", "state" : { - "revision" : "ae98338a8e660ae547b058ebb69c010e70b64e31", - "version" : "3.0.0" + "revision" : "eae73235dd6a8fb9177a75da929e8bbd637c1285", + "version" : "4.0.1" } }, { @@ -50,8 +51,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/mattpolzin/OpenAPIReflection.git", "state" : { - "revision" : "aa9d56c75b913818c513a3b0a2cd716b8443e81e", - "version" : "2.0.0" + "revision" : "d5981296867215f62363d6c88cf05c8d71cf8d48", + "version" : "3.0.0" } }, { @@ -59,8 +60,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/mattpolzin/Poly.git", "state" : { - "revision" : "c108e9e0a2904134719b082f6c18d64406afc6db", - "version" : "2.6.0" + "revision" : "37c942daa23ab373ce05ef87f42103342e59cf3a", + "version" : "3.0.0" } }, { @@ -77,17 +78,17 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-argument-parser.git", "state" : { - "revision" : "8f4d2753f0e4778c76d5f05ad16c74f707390531", - "version" : "1.2.3" + "revision" : "309a47b2b1d9b5e991f36961c983ecec72275be3", + "version" : "1.6.1" } }, { "identity" : "swift-cmark", "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-cmark.git", + "location" : "https://github.com/swiftlang/swift-cmark.git", "state" : { - "revision" : "f218e5d7691f78b55bfa39b367763f4612486c35", - "version" : "0.3.0" + "revision" : "b022b08312decdc46585e0b3440d97f6f22ef703", + "version" : "0.6.0" } }, { @@ -104,8 +105,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-markdown.git", "state" : { - "revision" : "e4f95e2dc23097a1a9a1dfdfe3fe3ee44de77378", - "version" : "0.3.0" + "revision" : "ea79e83c8744d2b50b0dc2d5bbd1e857e1253bf9", + "version" : "0.6.0" } }, { @@ -120,10 +121,10 @@ { "identity" : "swift-syntax", "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-syntax", + "location" : "https://github.com/apple/swift-syntax.git", "state" : { - "revision" : "6ad4ea24b01559dde0773e3d091f1b9e36175036", - "version" : "509.0.2" + "revision" : "64889f0c732f210a935a0ad7cda38f77f876262d", + "version" : "509.1.1" } }, { @@ -134,16 +135,7 @@ "revision" : "077c096c3ddfc38db223ac8e525ad16ffb987138", "version" : "0.12.0" } - }, - { - "identity" : "yams", - "kind" : "remoteSourceControl", - "location" : "https://github.com/jpsim/Yams.git", - "state" : { - "revision" : "0d9ee7ea8c4ebd4a489ad7a73d5c6cad55d6fed3", - "version" : "5.0.6" - } } ], - "version" : 2 + "version" : 3 } diff --git a/Package.swift b/Package.swift index 41fb1e3..8bc7b71 100644 --- a/Package.swift +++ b/Package.swift @@ -1,11 +1,12 @@ -// swift-tools-version:5.8 +// swift-tools-version:6.0 import PackageDescription let package = Package( name: "JSONAPI-OpenAPI", platforms: [ - .macOS(.v12), + .macOS(.v10_15), + .iOS(.v13), ], products: [ .library( @@ -20,13 +21,13 @@ let package = Package( ], dependencies: [ .package(url: "https://github.com/mattpolzin/Sampleable.git", from: "2.0.0"), - .package(url: "https://github.com/mattpolzin/JSONAPI.git", from: "5.0.0"), - .package(url: "https://github.com/mattpolzin/OpenAPIKit.git", from: "3.0.0"), - .package(url: "https://github.com/mattpolzin/OpenAPIReflection.git", from: "2.0.0"), + .package(url: "https://github.com/mattpolzin/JSONAPI.git", from: "6.0.0"), + .package(url: "https://github.com/mattpolzin/OpenAPIKit.git", from: "4.0.0"), + .package(url: "https://github.com/mattpolzin/OpenAPIReflection.git", from: "3.0.0"), .package(url: "https://github.com/typelift/SwiftCheck.git", .upToNextMinor(from: "0.12.0")), .package(url: "https://github.com/apple/swift-format.git", from: "509.0.0"), .package(url: "https://github.com/pointfreeco/swift-nonempty.git", .upToNextMinor(from: "0.2.0")), - .package(url: "https://github.com/mattpolzin/JSONAPIViz.git", exact: "0.0.6") + .package(url: "https://github.com/mattpolzin/JSONAPIViz.git", exact: "0.0.7") ], targets: [ .target( @@ -81,5 +82,5 @@ let package = Package( ] ) ], - swiftLanguageVersions: [.v5] + swiftLanguageModes: [.v5] ) diff --git a/README.md b/README.md index bd8adcc..d570c0b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # JSONAPI+OpenAPI -[![MIT license](http://img.shields.io/badge/license-MIT-lightgrey.svg)](http://opensource.org/licenses/MIT) [![Swift 5.9](http://img.shields.io/badge/Swift-5.9-blue.svg)](https://swift.org) [![Build Status](https://app.bitrise.io/app/2ae0b5578e1905b8/status.svg?token=T8UAUN08e1_GnYk1z3P98g&branch=main)](https://app.bitrise.io/app/2ae0b5578e1905b8) +[![MIT license](http://img.shields.io/badge/license-MIT-lightgrey.svg)](http://opensource.org/licenses/MIT) [![Swift 6.0+](http://img.shields.io/badge/Swift-6.x-blue.svg)](https://swift.org) [![Build Status](https://app.bitrise.io/app/2ae0b5578e1905b8/status.svg?token=T8UAUN08e1_GnYk1z3P98g&branch=main)](https://app.bitrise.io/app/2ae0b5578e1905b8) See parent project: https://github.com/mattpolzin/JSONAPI diff --git a/Tests/JSONAPIOpenAPITests/JSONAPIAttributeOpenAPITests.swift b/Tests/JSONAPIOpenAPITests/JSONAPIAttributeOpenAPITests.swift index 6296d14..ffe20ae 100644 --- a/Tests/JSONAPIOpenAPITests/JSONAPIAttributeOpenAPITests.swift +++ b/Tests/JSONAPIOpenAPITests/JSONAPIAttributeOpenAPITests.swift @@ -651,6 +651,7 @@ extension JSONAPIAttributeOpenAPITests { // MARK: - Date extension JSONAPIAttributeOpenAPITests { +#if os(macOS) || os(iOS) func test_DateStringAttribute() { // TEST: // Encoder is set to use @@ -805,6 +806,7 @@ extension JSONAPIAttributeOpenAPITests { XCTAssertEqual(stringContext, .init()) } +#endif func test_8601DateStringAttribute() { if #available(OSX 10.12, *) { diff --git a/Tests/JSONAPIOpenAPITests/JSONAPIEntityOpenAPITests.swift b/Tests/JSONAPIOpenAPITests/JSONAPIEntityOpenAPITests.swift index 5a3e3e6..c2a81bc 100644 --- a/Tests/JSONAPIOpenAPITests/JSONAPIEntityOpenAPITests.swift +++ b/Tests/JSONAPIOpenAPITests/JSONAPIEntityOpenAPITests.swift @@ -198,6 +198,7 @@ class JSONAPIEntityOpenAPITests: XCTestCase { ) ) +#if os(macOS) || os(iOS) XCTAssertEqual( attributesContext.properties["dateProperty"], .string( @@ -209,6 +210,19 @@ class JSONAPIEntityOpenAPITests: XCTestCase { .init() ) ) +#else + XCTAssertEqual( + attributesContext.properties["dateProperty"], + .string( + .init( + format: .generic, + required: true, + allowedValues: nil + ), + .init() + ) + ) +#endif XCTAssertEqual( attributesContext.properties["optionalProperty"], diff --git a/Tests/JSONAPIOpenAPITests/JSONAPITransformedAttributeOpenAPITests.swift b/Tests/JSONAPIOpenAPITests/JSONAPITransformedAttributeOpenAPITests.swift index 51ead8a..189ce92 100644 --- a/Tests/JSONAPIOpenAPITests/JSONAPITransformedAttributeOpenAPITests.swift +++ b/Tests/JSONAPIOpenAPITests/JSONAPITransformedAttributeOpenAPITests.swift @@ -657,6 +657,7 @@ extension JSONAPITransformedAttributeOpenAPITests { // MARK: - Date extension JSONAPITransformedAttributeOpenAPITests { +#if os(macOS) || os(iOS) func test_DateStringAttribute() { // TEST: // Encoder is set to use @@ -711,7 +712,6 @@ extension JSONAPITransformedAttributeOpenAPITests { let encoder = JSONEncoder() encoder.outputFormatting = .prettyPrinted encoder.dateEncodingStrategy = .formatted(dateFormatter) - let node = IdentityAttribute.dateOpenAPISchemaGuess(using: encoder)! XCTAssertTrue(node.required) @@ -812,6 +812,7 @@ extension JSONAPITransformedAttributeOpenAPITests { XCTAssertEqual(stringContext, .init()) } +#endif func test_8601DateStringAttribute() { if #available(OSX 10.12, *) {