From 3d8d10584b8f9355fa09024ec76cba4c9562f6c8 Mon Sep 17 00:00:00 2001 From: Mathew Polzin Date: Mon, 26 Nov 2018 22:27:10 -0800 Subject: [PATCH] Add typealiases to make accessing Entity Relationships and Attributes types more convenient --- Sources/JSONAPI/Resource/Entity.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/JSONAPI/Resource/Entity.swift b/Sources/JSONAPI/Resource/Entity.swift index 09d4551..6a54635 100644 --- a/Sources/JSONAPI/Resource/Entity.swift +++ b/Sources/JSONAPI/Resource/Entity.swift @@ -40,6 +40,9 @@ public protocol EntityDescription { public protocol EntityType: PrimaryResource { associatedtype Description: EntityDescription associatedtype Identifier: Equatable & Codable + + typealias Attributes = Description.Attributes + typealias Relationships = Description.Relationships } /// An `Entity` is a single model type that can be