mirror of
https://github.com/encounter/JSONAPI.git
synced 2026-03-30 11:18:38 -07:00
30 lines
544 B
Swift
30 lines
544 B
Swift
//
|
|
// Examples.swift
|
|
// JSONAPI
|
|
//
|
|
// Created by Mathew Polzin on 11/12/18.
|
|
//
|
|
|
|
import JSONAPI
|
|
|
|
enum PersonDescription: IdentifiedEntityDescription {
|
|
static var type: String { return "people" }
|
|
|
|
typealias Identifier = Id<String, PersonDescription>
|
|
|
|
struct Attributes: JSONAPI.Attributes {
|
|
let name: [String]
|
|
let favoriteColor: String
|
|
}
|
|
|
|
struct Relationships: JSONAPI.Relationships {
|
|
let friends: ToManyRelationship<PersonDescription>
|
|
}
|
|
}
|
|
|
|
typealias Person = Entity<PersonDescription>
|
|
|
|
func tmp() {
|
|
let x: Person.Identifier
|
|
}
|