You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/usage.md
+65Lines changed: 65 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -509,6 +509,71 @@ A `Links` struct must contain only `Link` properties. Each `Link` property can e
509
509
510
510
You can specify `NoLinks` if the part of the document being described should not contain any `Links`.
511
511
512
+
**IMPORTANT:** The URL type used in links is a type conforming to `JSONAPIURL`. Any type that is both `Codable` and `Equatable` is eligible, but it must be conformed explicitly.
513
+
514
+
For example,
515
+
```swift
516
+
extensionFoundation.URL: JSONAPIURL {}
517
+
extensionString: JSONAPIURL {}
518
+
```
519
+
520
+
Here's an example of an "article" resource with some links object and some JSON it would be capable of parsing:
If you want to create new `JSONAPI.ResourceObject` values and assign them Ids then you will need to conform at least one type to `CreatableRawIdType`. Doing so is easy; here are two example conformances for `UUID` and `String` (via `UUID`):
0 commit comments