2018-11-12 22:24:54 -08:00
|
|
|
//
|
|
|
|
|
// Examples.swift
|
|
|
|
|
// JSONAPI
|
|
|
|
|
//
|
|
|
|
|
// Created by Mathew Polzin on 11/12/18.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
import JSONAPI
|
|
|
|
|
|
2018-11-13 01:08:23 -08:00
|
|
|
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>
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-11-12 22:24:54 -08:00
|
|
|
|
2018-11-13 01:08:23 -08:00
|
|
|
typealias Person = Entity<PersonDescription>
|
|
|
|
|
|
|
|
|
|
func tmp() {
|
|
|
|
|
let x: Person.Identifier
|
|
|
|
|
}
|