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