Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
52 changes: 22 additions & 30 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -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(
Expand All @@ -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(
Expand Down Expand Up @@ -81,5 +82,5 @@ let package = Package(
]
)
],
swiftLanguageVersions: [.v5]
swiftLanguageModes: [.v5]
)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 2 additions & 0 deletions Tests/JSONAPIOpenAPITests/JSONAPIAttributeOpenAPITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@ extension JSONAPIAttributeOpenAPITests {

// MARK: - Date
extension JSONAPIAttributeOpenAPITests {
#if os(macOS) || os(iOS)
func test_DateStringAttribute() {
// TEST:
// Encoder is set to use
Expand Down Expand Up @@ -805,6 +806,7 @@ extension JSONAPIAttributeOpenAPITests {

XCTAssertEqual(stringContext, .init())
}
#endif

func test_8601DateStringAttribute() {
if #available(OSX 10.12, *) {
Expand Down
14 changes: 14 additions & 0 deletions Tests/JSONAPIOpenAPITests/JSONAPIEntityOpenAPITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ class JSONAPIEntityOpenAPITests: XCTestCase {
)
)

#if os(macOS) || os(iOS)
XCTAssertEqual(
attributesContext.properties["dateProperty"],
.string(
Expand All @@ -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"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@ extension JSONAPITransformedAttributeOpenAPITests {

// MARK: - Date
extension JSONAPITransformedAttributeOpenAPITests {
#if os(macOS) || os(iOS)
func test_DateStringAttribute() {
// TEST:
// Encoder is set to use
Expand Down Expand Up @@ -711,7 +712,6 @@ extension JSONAPITransformedAttributeOpenAPITests {
let encoder = JSONEncoder()
encoder.outputFormatting = .prettyPrinted
encoder.dateEncodingStrategy = .formatted(dateFormatter)

let node = IdentityAttribute<Date>.dateOpenAPISchemaGuess(using: encoder)!

XCTAssertTrue(node.required)
Expand Down Expand Up @@ -812,6 +812,7 @@ extension JSONAPITransformedAttributeOpenAPITests {

XCTAssertEqual(stringContext, .init())
}
#endif

func test_8601DateStringAttribute() {
if #available(OSX 10.12, *) {
Expand Down