Skip to content

Commit f959054

Browse files
authored
Merge pull request #28 from mattpolzin/update-openapi-kit-and-modernize
Update OpenAPIKit and JSONAPI
2 parents 8ac5e4f + 3aa205a commit f959054

7 files changed

Lines changed: 56 additions & 46 deletions

File tree

.github/workflows/tests.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,24 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
image:
16-
- swift:5.9-focal
17-
- swift:5.9-jammy
18-
- swift:5.10-focal
19-
- swift:5.10-jammy
16+
- swift:6.0-focal
17+
- swift:6.0-jammy
18+
- swift:6.1-focal
19+
- swift:6.1-jammy
2020
container: ${{ matrix.image }}
2121
steps:
2222
- name: Checkout code
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@v5
2424
- name: Run tests
2525
run: swift test
2626
osx:
27-
runs-on: macOS-13
27+
runs-on: macOS-15
2828
steps:
2929
- name: Select latest available Xcode
3030
uses: maxim-lobanov/setup-xcode@v1
3131
with:
3232
xcode-version: latest
3333
- name: Checkout code
34-
uses: actions/checkout@v3
34+
uses: actions/checkout@v5
3535
- name: Run tests
3636
run: swift test

Package.resolved

Lines changed: 22 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
// swift-tools-version:5.8
1+
// swift-tools-version:6.0
22

33
import PackageDescription
44

55
let package = Package(
66
name: "JSONAPI-OpenAPI",
77
platforms: [
8-
.macOS(.v12),
8+
.macOS(.v10_15),
9+
.iOS(.v13),
910
],
1011
products: [
1112
.library(
@@ -20,13 +21,13 @@ let package = Package(
2021
],
2122
dependencies: [
2223
.package(url: "https://github.com/mattpolzin/Sampleable.git", from: "2.0.0"),
23-
.package(url: "https://github.com/mattpolzin/JSONAPI.git", from: "5.0.0"),
24-
.package(url: "https://github.com/mattpolzin/OpenAPIKit.git", from: "3.0.0"),
25-
.package(url: "https://github.com/mattpolzin/OpenAPIReflection.git", from: "2.0.0"),
24+
.package(url: "https://github.com/mattpolzin/JSONAPI.git", from: "6.0.0"),
25+
.package(url: "https://github.com/mattpolzin/OpenAPIKit.git", from: "4.0.0"),
26+
.package(url: "https://github.com/mattpolzin/OpenAPIReflection.git", from: "3.0.0"),
2627
.package(url: "https://github.com/typelift/SwiftCheck.git", .upToNextMinor(from: "0.12.0")),
2728
.package(url: "https://github.com/apple/swift-format.git", from: "509.0.0"),
2829
.package(url: "https://github.com/pointfreeco/swift-nonempty.git", .upToNextMinor(from: "0.2.0")),
29-
.package(url: "https://github.com/mattpolzin/JSONAPIViz.git", exact: "0.0.6")
30+
.package(url: "https://github.com/mattpolzin/JSONAPIViz.git", exact: "0.0.7")
3031
],
3132
targets: [
3233
.target(
@@ -81,5 +82,5 @@ let package = Package(
8182
]
8283
)
8384
],
84-
swiftLanguageVersions: [.v5]
85+
swiftLanguageModes: [.v5]
8586
)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# JSONAPI+OpenAPI
2-
[![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)
2+
[![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)
33

44
See parent project: https://github.com/mattpolzin/JSONAPI
55

Tests/JSONAPIOpenAPITests/JSONAPIAttributeOpenAPITests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,7 @@ extension JSONAPIAttributeOpenAPITests {
651651

652652
// MARK: - Date
653653
extension JSONAPIAttributeOpenAPITests {
654+
#if os(macOS) || os(iOS)
654655
func test_DateStringAttribute() {
655656
// TEST:
656657
// Encoder is set to use
@@ -805,6 +806,7 @@ extension JSONAPIAttributeOpenAPITests {
805806

806807
XCTAssertEqual(stringContext, .init())
807808
}
809+
#endif
808810

809811
func test_8601DateStringAttribute() {
810812
if #available(OSX 10.12, *) {

Tests/JSONAPIOpenAPITests/JSONAPIEntityOpenAPITests.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ class JSONAPIEntityOpenAPITests: XCTestCase {
198198
)
199199
)
200200

201+
#if os(macOS) || os(iOS)
201202
XCTAssertEqual(
202203
attributesContext.properties["dateProperty"],
203204
.string(
@@ -209,6 +210,19 @@ class JSONAPIEntityOpenAPITests: XCTestCase {
209210
.init()
210211
)
211212
)
213+
#else
214+
XCTAssertEqual(
215+
attributesContext.properties["dateProperty"],
216+
.string(
217+
.init(
218+
format: .generic,
219+
required: true,
220+
allowedValues: nil
221+
),
222+
.init()
223+
)
224+
)
225+
#endif
212226

213227
XCTAssertEqual(
214228
attributesContext.properties["optionalProperty"],

Tests/JSONAPIOpenAPITests/JSONAPITransformedAttributeOpenAPITests.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,7 @@ extension JSONAPITransformedAttributeOpenAPITests {
657657

658658
// MARK: - Date
659659
extension JSONAPITransformedAttributeOpenAPITests {
660+
#if os(macOS) || os(iOS)
660661
func test_DateStringAttribute() {
661662
// TEST:
662663
// Encoder is set to use
@@ -711,7 +712,6 @@ extension JSONAPITransformedAttributeOpenAPITests {
711712
let encoder = JSONEncoder()
712713
encoder.outputFormatting = .prettyPrinted
713714
encoder.dateEncodingStrategy = .formatted(dateFormatter)
714-
715715
let node = IdentityAttribute<Date>.dateOpenAPISchemaGuess(using: encoder)!
716716

717717
XCTAssertTrue(node.required)
@@ -812,6 +812,7 @@ extension JSONAPITransformedAttributeOpenAPITests {
812812

813813
XCTAssertEqual(stringContext, .init())
814814
}
815+
#endif
815816

816817
func test_8601DateStringAttribute() {
817818
if #available(OSX 10.12, *) {

0 commit comments

Comments
 (0)