Skip to content

Commit 1ab9663

Browse files
authored
Merge pull request #13 from mattpolzin/jsonapi-v5
JSONAPI v5 release
2 parents ceced63 + 1f6dbd5 commit 1ab9663

File tree

7 files changed

+54
-54
lines changed

7 files changed

+54
-54
lines changed

.github/workflows/tests.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
image:
16-
- swift:5.2-xenial
17-
- swift:5.2-bionic
18-
- swift:5.2-focal
19-
- swift:5.2-centos8
20-
- swift:5.2-amazonlinux2
21-
- swiftlang/swift:nightly-5.3-xenial
22-
- swiftlang/swift:nightly-5.3-bionic
16+
- swift:5.3-xenial
17+
- swift:5.3-bionic
18+
- swift:5.3-focal
19+
- swift:5.3-centos8
20+
- swift:5.3-amazonlinux2
2321
container: ${{ matrix.image }}
2422
steps:
2523
- name: Checkout code

Package.resolved

+23-23
Original file line numberDiff line numberDiff line change
@@ -30,43 +30,43 @@
3030
},
3131
{
3232
"package": "JSONAPI",
33-
"repositoryURL": "https://github.com/mattpolzin/JSONAPI",
33+
"repositoryURL": "https://github.com/mattpolzin/JSONAPI.git",
3434
"state": {
3535
"branch": null,
36-
"revision": "51cb140ebf27949d1185227e3eaef5a54d9a3bee",
37-
"version": "4.0.0"
36+
"revision": "c645c73f51808b85a881e8af6f286086ee65cc35",
37+
"version": "5.0.0"
3838
}
3939
},
4040
{
4141
"package": "JSONAPIViz",
42-
"repositoryURL": "https://github.com/mattpolzin/JSONAPIViz",
42+
"repositoryURL": "https://github.com/mattpolzin/JSONAPIViz.git",
4343
"state": {
4444
"branch": null,
45-
"revision": "95b14e304459038ae63a7c3518abf5ea390cdee8",
46-
"version": "0.0.5"
45+
"revision": "407422e121c2d73f6dd262071df62481cb4016e9",
46+
"version": "0.0.6"
4747
}
4848
},
4949
{
5050
"package": "OpenAPIKit",
51-
"repositoryURL": "https://github.com/mattpolzin/OpenAPIKit",
51+
"repositoryURL": "https://github.com/mattpolzin/OpenAPIKit.git",
5252
"state": {
5353
"branch": null,
54-
"revision": "201586db9dcce99d148eed12cc556a0c86c3355e",
55-
"version": "1.4.0"
54+
"revision": "9c08102046ea58dd13bd3a705357af64e85ff51a",
55+
"version": "1.5.1"
5656
}
5757
},
5858
{
5959
"package": "OpenAPIReflection",
60-
"repositoryURL": "https://github.com/mattpolzin/OpenAPIReflection",
60+
"repositoryURL": "https://github.com/mattpolzin/OpenAPIReflection.git",
6161
"state": {
6262
"branch": null,
63-
"revision": "34eb557d0ab49a95d3a39e7a821fcb12ff50ba8a",
64-
"version": "0.3.0"
63+
"revision": "7386d2956d4562f9d1d695842b344c78a5cbc794",
64+
"version": "0.3.1"
6565
}
6666
},
6767
{
6868
"package": "Poly",
69-
"repositoryURL": "https://github.com/mattpolzin/Poly",
69+
"repositoryURL": "https://github.com/mattpolzin/Poly.git",
7070
"state": {
7171
"branch": null,
7272
"revision": "36ba3f624bffa34f5f9b9c7648eab3cfdcab4748",
@@ -84,7 +84,7 @@
8484
},
8585
{
8686
"package": "Sampleable",
87-
"repositoryURL": "https://github.com/mattpolzin/Sampleable",
87+
"repositoryURL": "https://github.com/mattpolzin/Sampleable.git",
8888
"state": {
8989
"branch": null,
9090
"revision": "df44bf1a860481109dcf455e3c6daf0a0f1bc259",
@@ -96,22 +96,22 @@
9696
"repositoryURL": "https://github.com/apple/swift-argument-parser.git",
9797
"state": {
9898
"branch": null,
99-
"revision": "223d62adc52d51669ae2ee19bdb8b7d9fd6fcd9c",
100-
"version": "0.0.6"
99+
"revision": "92646c0cdbaca076c8d3d0207891785b3379cbff",
100+
"version": "0.3.1"
101101
}
102102
},
103103
{
104104
"package": "swift-format",
105-
"repositoryURL": "https://github.com/apple/swift-format",
105+
"repositoryURL": "https://github.com/apple/swift-format.git",
106106
"state": {
107107
"branch": null,
108-
"revision": "f22aade8a6ee061b4a7041601ededd8ad7bc2122",
109-
"version": "0.50200.1"
108+
"revision": "12089179aa1668a2478b2b2111d98fa37f3531e3",
109+
"version": "0.50300.0"
110110
}
111111
},
112112
{
113113
"package": "NonEmpty",
114-
"repositoryURL": "https://github.com/pointfreeco/swift-nonempty",
114+
"repositoryURL": "https://github.com/pointfreeco/swift-nonempty.git",
115115
"state": {
116116
"branch": null,
117117
"revision": "9ef8c4aea57b8da7fedd5303d29470ea2a00c08d",
@@ -123,8 +123,8 @@
123123
"repositoryURL": "https://github.com/apple/swift-syntax",
124124
"state": {
125125
"branch": null,
126-
"revision": "0688b9cfc4c3dd234e4f55f1f056b2affc849873",
127-
"version": "0.50200.0"
126+
"revision": "844574d683f53d0737a9c6d706c3ef31ed2955eb",
127+
"version": "0.50300.0"
128128
}
129129
},
130130
{
@@ -138,7 +138,7 @@
138138
},
139139
{
140140
"package": "SwiftCheck",
141-
"repositoryURL": "https://github.com/typelift/SwiftCheck",
141+
"repositoryURL": "https://github.com/typelift/SwiftCheck.git",
142142
"state": {
143143
"branch": null,
144144
"revision": "077c096c3ddfc38db223ac8e525ad16ffb987138",

Package.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ let package = Package(
1717
],
1818
dependencies: [
1919
.package(url: "https://github.com/mattpolzin/Sampleable.git", from: "2.0.0"),
20-
.package(url: "https://github.com/mattpolzin/JSONAPI.git", from: "4.0.0"),
20+
.package(url: "https://github.com/mattpolzin/JSONAPI.git", from: "5.0.0"),
2121
.package(url: "https://github.com/mattpolzin/OpenAPIKit.git", from: "1.4.0"),
2222
.package(url: "https://github.com/mattpolzin/OpenAPIReflection.git", .upToNextMinor(from: "0.3.0")),
2323
.package(url: "https://github.com/typelift/SwiftCheck.git", .upToNextMinor(from: "0.12.0")),
24-
.package(url: "https://github.com/apple/swift-format.git", from: "0.50200.1"),
24+
.package(url: "https://github.com/apple/swift-format.git", from: "0.50300.0"),
2525
.package(name: "NonEmpty", url: "https://github.com/pointfreeco/swift-nonempty.git", .upToNextMinor(from: "0.2.0")),
26-
.package(url: "https://github.com/mattpolzin/JSONAPIViz.git", .upToNextMinor(from: "0.0.5"))
26+
.package(url: "https://github.com/mattpolzin/JSONAPIViz.git", .exact("0.0.6"))
2727
],
2828
targets: [
2929
.target(

README.md

+1-1
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.1/5.2](http://img.shields.io/badge/Swift-5.1/5.2-blue.svg)](https://swift.org) [![Build Status](https://app.bitrise.io/app/2ae0b5578e1905b8/status.svg?token=T8UAUN08e1_GnYk1z3P98g&branch=master)](https://app.bitrise.io/app/2ae0b5578e1905b8)
2+
[![MIT license](http://img.shields.io/badge/license-MIT-lightgrey.svg)](http://opensource.org/licenses/MIT) [![Swift 5.3](http://img.shields.io/badge/Swift-5.3-blue.svg)](https://swift.org) [![Build Status](https://app.bitrise.io/app/2ae0b5578e1905b8/status.svg?token=T8UAUN08e1_GnYk1z3P98g&branch=master)](https://app.bitrise.io/app/2ae0b5578e1905b8)
33

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

Tests/JSONAPIOpenAPITests/JSONAPIEntityOpenAPITests.swift

+14-12
Original file line numberDiff line numberDiff line change
@@ -342,23 +342,25 @@ extension JSONAPIEntityOpenAPITests {
342342
public typealias Attributes = NoAttributes
343343

344344
public struct Relationships: JSONAPI.Relationships, Sampleable {
345-
public let toOne: ToOneRelationship<TestType1, NoMetadata, NoLinks>
346-
public let optionalTooOne: ToOneRelationship<TestType1, NoMetadata, NoLinks>?
347-
public let nullableToOne: ToOneRelationship<TestType1?, NoMetadata, NoLinks>
348-
public let nullableOptionalToOne: ToOneRelationship<TestType1?, NoMetadata, NoLinks>?
345+
public let toOne: ToOneRelationship<TestType1, NoIdMetadata, NoMetadata, NoLinks>
346+
public let optionalTooOne: ToOneRelationship<TestType1, NoIdMetadata, NoMetadata, NoLinks>?
347+
public let nullableToOne: ToOneRelationship<TestType1?, NoIdMetadata, NoMetadata, NoLinks>
348+
public let nullableOptionalToOne: ToOneRelationship<TestType1?, NoIdMetadata, NoMetadata, NoLinks>?
349349

350-
public let toMany: ToManyRelationship<TestType1, NoMetadata, NoLinks>
351-
public let optionalToMany: ToManyRelationship<TestType1, NoMetadata, NoLinks>?
350+
public let toMany: ToManyRelationship<TestType1, NoIdMetadata, NoMetadata, NoLinks>
351+
public let optionalToMany: ToManyRelationship<TestType1, NoIdMetadata, NoMetadata, NoLinks>?
352352
// Note there is no such thing as nullable to-many relationships (Just use
353353
// an empty array)
354354

355355
public static var sample: Relationships {
356-
return Relationships(toOne: .init(id: .init(rawValue: "1")),
357-
optionalTooOne: nil,
358-
nullableToOne: .init(id: nil),
359-
nullableOptionalToOne: nil,
360-
toMany: .init(ids: [.init(rawValue: "1")]),
361-
optionalToMany: nil)
356+
return Relationships(
357+
toOne: .init(id: .init(rawValue: "1")),
358+
optionalTooOne: nil,
359+
nullableToOne: .init(id: nil),
360+
nullableOptionalToOne: nil,
361+
toMany: .init(ids: [.init(rawValue: "1")]),
362+
optionalToMany: nil
363+
)
362364
}
363365
}
364366
}

Tests/JSONAPIOpenAPITests/JSONAPIRelationshipsOpenAPITests.swift

+7-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import JSONAPIOpenAPI
1515
class JSONAPIRelationshipsOpenAPITests: XCTestCase {
1616

1717
func test_ToOne() {
18-
let node = ToOneRelationship<TestEntity1, NoMetadata, NoLinks>.openAPISchema
18+
let node = ToOneRelationship<TestEntity1, NoIdMetadata, NoMetadata, NoLinks>.openAPISchema
1919

2020
XCTAssertTrue(node.required)
2121
XCTAssertEqual(node.jsonTypeFormat, .object(.generic))
@@ -48,7 +48,7 @@ class JSONAPIRelationshipsOpenAPITests: XCTestCase {
4848
}
4949

5050
func test_OptionalToOne() {
51-
let node = ToOneRelationship<TestEntity1, NoMetadata, NoLinks>?.openAPISchema
51+
let node = ToOneRelationship<TestEntity1, NoIdMetadata, NoMetadata, NoLinks>?.openAPISchema
5252

5353
XCTAssertFalse(node.required)
5454
XCTAssertEqual(node.jsonTypeFormat, .object(.generic))
@@ -81,7 +81,7 @@ class JSONAPIRelationshipsOpenAPITests: XCTestCase {
8181
}
8282

8383
func test_NullableToOne() {
84-
let node = ToOneRelationship<TestEntity1?, NoMetadata, NoLinks>.openAPISchema
84+
let node = ToOneRelationship<TestEntity1?, NoIdMetadata, NoMetadata, NoLinks>.openAPISchema
8585

8686
XCTAssertTrue(node.required)
8787
XCTAssertEqual(node.jsonTypeFormat, .object(.generic))
@@ -114,7 +114,7 @@ class JSONAPIRelationshipsOpenAPITests: XCTestCase {
114114
}
115115

116116
func test_OptionalNullableToOne() {
117-
let node = ToOneRelationship<TestEntity1?, NoMetadata, NoLinks>?.openAPISchema
117+
let node = ToOneRelationship<TestEntity1?, NoIdMetadata, NoMetadata, NoLinks>?.openAPISchema
118118

119119
XCTAssertFalse(node.required)
120120
XCTAssertEqual(node.jsonTypeFormat, .object(.generic))
@@ -147,7 +147,7 @@ class JSONAPIRelationshipsOpenAPITests: XCTestCase {
147147
}
148148

149149
func test_ToMany() {
150-
let node = ToManyRelationship<TestEntity1, NoMetadata, NoLinks>.openAPISchema
150+
let node = ToManyRelationship<TestEntity1, NoIdMetadata, NoMetadata, NoLinks>.openAPISchema
151151

152152
XCTAssertTrue(node.required)
153153
XCTAssertEqual(node.jsonTypeFormat, .object(.generic))
@@ -190,7 +190,7 @@ class JSONAPIRelationshipsOpenAPITests: XCTestCase {
190190
}
191191

192192
func test_OptionalToMany() {
193-
let node = ToManyRelationship<TestEntity1, NoMetadata, NoLinks>?.openAPISchema
193+
let node = ToManyRelationship<TestEntity1, NoIdMetadata, NoMetadata, NoLinks>?.openAPISchema
194194

195195
XCTAssertFalse(node.required)
196196
XCTAssertEqual(node.jsonTypeFormat, .object(.generic))
@@ -250,7 +250,7 @@ extension JSONAPIRelationshipsOpenAPITests {
250250
typealias Attributes = NoAttributes
251251

252252
struct Relationships: JSONAPI.Relationships {
253-
let other: ToOneRelationship<TestEntity1, NoMetadata, NoLinks>
253+
let other: ToOneRelationship<TestEntity1, NoIdMetadata, NoMetadata, NoLinks>
254254
}
255255
}
256256

Tests/JSONAPISwiftGenTests/ResourceObjectSwiftGenTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ enum TestPersonDescription: JSONAPI.ResourceObjectDescription {
8080
}
8181

8282
struct Relationships: JSONAPI.Relationships {
83-
let friends: ToManyRelationship<TestPerson, NoMetadata, NoLinks>
83+
let friends: ToManyRelationship<TestPerson, NoIdMetadata, NoMetadata, NoLinks>
8484
}
8585
}
8686

0 commit comments

Comments
 (0)