Skip to content

Commit

Permalink
Expose Entity properties on EntityType protocol.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpolzin committed Nov 28, 2018
1 parent 921bcef commit fcc1796
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Sources/JSONAPI/Resource/Entity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ public protocol EntityType: PrimaryResource {

typealias Attributes = Description.Attributes
typealias Relationships = Description.Relationships

/// The `Entity`'s Id. This can be of type `Unidentified` if
/// the entity is being created clientside and the
/// server is being asked to create a unique Id. Otherwise,
/// this should be of a type conforming to `IdType`.
var id: Identifier { get }

/// The JSON API compliant attributes of this `Entity`.
var attributes: Attributes { get }

/// The JSON API compliant relationships of this `Entity`.
var relationships: Relationships { get }
}

/// An `Entity` is a single model type that can be
Expand Down

0 comments on commit fcc1796

Please sign in to comment.