From 2bb238b092210ca73572828785d22805653eb946 Mon Sep 17 00:00:00 2001 From: Mathew Polzin Date: Wed, 12 Jun 2019 19:07:21 -0700 Subject: [PATCH] Renamed EntityProxyDescription to ResourceObjectProxyDescription and EntityDescription to ResourceObjectDescription. --- .../Contents.swift | 8 +++--- .../Contents.swift | 4 +-- JSONAPI.playground/Sources/Entities.swift | 10 +++---- Sources/JSONAPI/Resource/Relationship.swift | 4 +-- .../{Entity.swift => ResourceObject.swift} | 16 +++++------ .../EntityCheckTests.swift | 14 +++++----- .../JSONAPITestingTests/Id+LiteralTests.swift | 2 +- .../Relationship+LiteralTests.swift | 2 +- .../Test Helpers/EntityTestTypes.swift | 6 ++-- .../Attribute/Attribute+FunctorTests.swift | 2 +- .../ComputedPropertiesTests.swift | 2 +- .../CustomAttributesTests.swift | 4 +-- .../JSONAPITests/Document/DocumentTests.swift | 4 +-- Tests/JSONAPITests/Entity/EntityTests.swift | 28 +++++++++---------- .../JSONAPITests/Includes/IncludeTests.swift | 18 ++++++------ .../NonJSONAPIRelatableTests.swift | 4 +-- Tests/JSONAPITests/Poly/PolyProxyTests.swift | 6 ++-- Tests/JSONAPITests/Poly/PolyTests.swift | 18 ++++++------ .../Relationships/RelationshipTests.swift | 2 +- .../ResourceBody/ResourceBodyTests.swift | 2 +- .../Test Helpers/EntityTestTypes.swift | 6 ++-- 21 files changed, 81 insertions(+), 81 deletions(-) rename Sources/JSONAPI/Resource/{Entity.swift => ResourceObject.swift} (97%) diff --git a/JSONAPI.playground/Pages/Full Client & Server Example.xcplaygroundpage/Contents.swift b/JSONAPI.playground/Pages/Full Client & Server Example.xcplaygroundpage/Contents.swift index 27ef739..863d298 100644 --- a/JSONAPI.playground/Pages/Full Client & Server Example.xcplaygroundpage/Contents.swift +++ b/JSONAPI.playground/Pages/Full Client & Server Example.xcplaygroundpage/Contents.swift @@ -19,13 +19,13 @@ extension String: CreatableRawIdType { // We create a typealias given that we do not expect JSON:API Resource // Objects for this particular API to have Metadata or Links associated // with them. We also expect them to have String Identifiers. -typealias JSONEntity = JSONAPI.Entity +typealias JSONEntity = JSONAPI.Entity // Similarly, we create a typealias for unidentified entities. JSON:API // only allows unidentified entities (i.e. no "id" field) for client // requests that create new entities. In these situations, the server // is expected to assign the new entity a unique ID. -typealias UnidentifiedJSONEntity = JSONAPI.Entity +typealias UnidentifiedJSONEntity = JSONAPI.Entity // We create typealiases given that we do not expect JSON:API Relationships // for this particular API to have Metadata or Links associated @@ -40,7 +40,7 @@ typealias Document -enum ArticleDescription: EntityDescription { +enum ArticleDescription: ResourceObjectDescription { public static var jsonType: String { return "articles" } public struct Attributes: JSONAPI.Attributes { diff --git a/JSONAPI.playground/Pages/Full Document Verbose Generation.xcplaygroundpage/Contents.swift b/JSONAPI.playground/Pages/Full Document Verbose Generation.xcplaygroundpage/Contents.swift index d6aa80b..4d8966f 100644 --- a/JSONAPI.playground/Pages/Full Document Verbose Generation.xcplaygroundpage/Contents.swift +++ b/JSONAPI.playground/Pages/Full Document Verbose Generation.xcplaygroundpage/Contents.swift @@ -64,7 +64,7 @@ struct ToManyRelationshipLinks: JSONAPI.Links { } /// Description of an Author entity. -enum AuthorDescription: EntityDescription { +enum AuthorDescription: ResourceObjectDescription { static var jsonType: String { return "authors" } struct Attributes: JSONAPI.Attributes { @@ -79,7 +79,7 @@ enum AuthorDescription: EntityDescription { typealias Author = JSONAPI.Entity /// Description of an Article entity. -enum ArticleDescription: EntityDescription { +enum ArticleDescription: ResourceObjectDescription { static var jsonType: String { return "articles" } struct Attributes: JSONAPI.Attributes { diff --git a/JSONAPI.playground/Sources/Entities.swift b/JSONAPI.playground/Sources/Entities.swift index 58345c9..c165d3d 100644 --- a/JSONAPI.playground/Sources/Entities.swift +++ b/JSONAPI.playground/Sources/Entities.swift @@ -24,12 +24,12 @@ extension String: CreatableRawIdType { } // MARK: - typealiases for convenience -public typealias ExampleEntity = Entity +public typealias ExampleEntity = Entity public typealias ToOne = ToOneRelationship public typealias ToMany = ToManyRelationship // MARK: - A few resource objects (entities) -public enum PersonDescription: EntityDescription { +public enum PersonDescription: ResourceObjectDescription { public static var jsonType: String { return "people" } @@ -68,7 +68,7 @@ public extension Entity where Description == PersonDescription, MetaType == NoMe } } -public enum DogDescription: EntityDescription { +public enum DogDescription: ResourceObjectDescription { public static var jsonType: String { return "dogs" } @@ -91,7 +91,7 @@ public enum DogDescription: EntityDescription { public typealias Dog = ExampleEntity -public enum AlternativeDogDescription: EntityDescription { +public enum AlternativeDogDescription: ResourceObjectDescription { public static var jsonType: String { return "dogs" } @@ -129,7 +129,7 @@ public extension Entity where Description == DogDescription, MetaType == NoMetad } } -public enum HouseDescription: EntityDescription { +public enum HouseDescription: ResourceObjectDescription { public static var jsonType: String { return "houses" } diff --git a/Sources/JSONAPI/Resource/Relationship.swift b/Sources/JSONAPI/Resource/Relationship.swift index e5e1e60..7b2ca68 100644 --- a/Sources/JSONAPI/Resource/Relationship.swift +++ b/Sources/JSONAPI/Resource/Relationship.swift @@ -16,7 +16,7 @@ public protocol RelationshipType { /// An Entity relationship that can be encoded to or decoded from /// a JSON API "Resource Linkage." /// See https://jsonapi.org/format/#document-resource-object-linkage -/// A convenient typealias might make your code much more legible: `One` +/// A convenient typealias might make your code much more legible: `One` public struct ToOneRelationship: RelationshipType, Equatable { public let id: Identifiable.Identifier @@ -64,7 +64,7 @@ extension ToOneRelationship where Identifiable: OptionalRelatable, MetaType == N /// An Entity relationship that can be encoded to or decoded from /// a JSON API "Resource Linkage." /// See https://jsonapi.org/format/#document-resource-object-linkage -/// A convenient typealias might make your code much more legible: `Many` +/// A convenient typealias might make your code much more legible: `Many` public struct ToManyRelationship: RelationshipType, Equatable { public let ids: [Relatable.Identifier] diff --git a/Sources/JSONAPI/Resource/Entity.swift b/Sources/JSONAPI/Resource/ResourceObject.swift similarity index 97% rename from Sources/JSONAPI/Resource/Entity.swift rename to Sources/JSONAPI/Resource/ResourceObject.swift index b3f56ca..4081145 100644 --- a/Sources/JSONAPI/Resource/Entity.swift +++ b/Sources/JSONAPI/Resource/ResourceObject.swift @@ -40,25 +40,25 @@ public protocol JSONTyped { static var jsonType: String { get } } -/// An `EntityProxyDescription` is an `EntityDescription` +/// A `ResourceObjectProxyDescription` is an `ResourceObjectDescription` /// without Codable conformance. -public protocol EntityProxyDescription: JSONTyped { +public protocol ResourceObjectProxyDescription: JSONTyped { associatedtype Attributes: Equatable associatedtype Relationships: Equatable } -/// An `EntityDescription` describes a JSON API +/// An `ResourceObjectDescription` describes a JSON API /// Resource Object. The Resource Object /// itself is encoded and decoded as an /// `Entity`, which gets specialized on an -/// `EntityDescription`. -public protocol EntityDescription: EntityProxyDescription where Attributes: JSONAPI.Attributes, Relationships: JSONAPI.Relationships {} +/// `ResourceObjectDescription`. +public protocol ResourceObjectDescription: ResourceObjectProxyDescription where Attributes: JSONAPI.Attributes, Relationships: JSONAPI.Relationships {} /// EntityProxy is a protocol that can be used to create /// types that _act_ like Entities but cannot be encoded /// or decoded as Entities. public protocol EntityProxy: Equatable, JSONTyped { - associatedtype Description: EntityProxyDescription + associatedtype Description: ResourceObjectProxyDescription associatedtype EntityRawIdType: JSONAPI.MaybeRawId typealias Id = JSONAPI.Id @@ -87,7 +87,7 @@ extension EntityProxy { /// EntityType is the protocol that Entity conforms to. This /// protocol lets other types accept any Entity as a generic /// specialization. -public protocol EntityType: EntityProxy, PrimaryResource where Description: EntityDescription { +public protocol EntityType: EntityProxy, PrimaryResource where Description: ResourceObjectDescription { associatedtype Meta: JSONAPI.Meta associatedtype Links: JSONAPI.Links } @@ -98,7 +98,7 @@ public protocol IdentifiableEntityType: EntityType, Relatable where EntityRawIdT /// encoded to or decoded from a JSON API /// "Resource Object." /// See https://jsonapi.org/format/#document-resource-objects -public struct Entity: EntityType { +public struct Entity: EntityType { public typealias Meta = MetaType public typealias Links = LinksType diff --git a/Tests/JSONAPITestingTests/EntityCheckTests.swift b/Tests/JSONAPITestingTests/EntityCheckTests.swift index 10d5a48..2710d83 100644 --- a/Tests/JSONAPITestingTests/EntityCheckTests.swift +++ b/Tests/JSONAPITestingTests/EntityCheckTests.swift @@ -40,7 +40,7 @@ class EntityCheckTests: XCTestCase { // MARK: - Test types extension EntityCheckTests { - enum OkDescription: EntityDescription { + enum OkDescription: ResourceObjectDescription { public static var jsonType: String { return "hello" } public typealias Attributes = NoAttributes @@ -49,7 +49,7 @@ extension EntityCheckTests { public typealias OkEntity = BasicEntity - enum OtherOkDescription: EntityDescription { + enum OtherOkDescription: ResourceObjectDescription { public static var jsonType: String { return "hmm" } public typealias Attributes = NoAttributes @@ -58,7 +58,7 @@ extension EntityCheckTests { public typealias OtherOkEntity = BasicEntity - enum EnumAttributesDescription: EntityDescription { + enum EnumAttributesDescription: ResourceObjectDescription { public static var jsonType: String { return "hello" } public enum Attributes: JSONAPI.Attributes { @@ -77,7 +77,7 @@ extension EntityCheckTests { public typealias EnumAttributesEntity = BasicEntity - enum EnumRelationshipsDescription: EntityDescription { + enum EnumRelationshipsDescription: ResourceObjectDescription { public static var jsonType: String { return "hello" } public typealias Attributes = NoAttributes @@ -96,7 +96,7 @@ extension EntityCheckTests { public typealias EnumRelationshipsEntity = BasicEntity - enum BadAttributeDescription: EntityDescription { + enum BadAttributeDescription: ResourceObjectDescription { public static var jsonType: String { return "hello" } public struct Attributes: JSONAPI.Attributes { @@ -109,7 +109,7 @@ extension EntityCheckTests { public typealias BadAttributeEntity = BasicEntity - enum BadRelationshipDescription: EntityDescription { + enum BadRelationshipDescription: ResourceObjectDescription { public static var jsonType: String { return "hello" } public typealias Attributes = NoAttributes @@ -122,7 +122,7 @@ extension EntityCheckTests { public typealias BadRelationshipEntity = BasicEntity - enum OptionalArrayAttributeDescription: EntityDescription { + enum OptionalArrayAttributeDescription: ResourceObjectDescription { public static var jsonType: String { return "hello" } public struct Attributes: JSONAPI.Attributes { diff --git a/Tests/JSONAPITestingTests/Id+LiteralTests.swift b/Tests/JSONAPITestingTests/Id+LiteralTests.swift index 2390fe0..4f915db 100644 --- a/Tests/JSONAPITestingTests/Id+LiteralTests.swift +++ b/Tests/JSONAPITestingTests/Id+LiteralTests.swift @@ -24,7 +24,7 @@ class Id_LiteralTests: XCTestCase { // MARK: - Test types extension Id_LiteralTests { - enum TestDescription: EntityDescription { + enum TestDescription: ResourceObjectDescription { public static var jsonType: String { return "test" } public typealias Attributes = NoAttributes diff --git a/Tests/JSONAPITestingTests/Relationship+LiteralTests.swift b/Tests/JSONAPITestingTests/Relationship+LiteralTests.swift index 9a2d7c9..4dff645 100644 --- a/Tests/JSONAPITestingTests/Relationship+LiteralTests.swift +++ b/Tests/JSONAPITestingTests/Relationship+LiteralTests.swift @@ -27,7 +27,7 @@ class Relationship_LiteralTests: XCTestCase { // MARK: - Test types extension Relationship_LiteralTests { - enum TestDescription: EntityDescription { + enum TestDescription: ResourceObjectDescription { public static var jsonType: String { return "test" } public typealias Attributes = NoAttributes diff --git a/Tests/JSONAPITestingTests/Test Helpers/EntityTestTypes.swift b/Tests/JSONAPITestingTests/Test Helpers/EntityTestTypes.swift index 23e6b7d..fe059c0 100644 --- a/Tests/JSONAPITestingTests/Test Helpers/EntityTestTypes.swift +++ b/Tests/JSONAPITestingTests/Test Helpers/EntityTestTypes.swift @@ -7,8 +7,8 @@ import JSONAPI -public typealias Entity = JSONAPI.Entity +public typealias Entity = JSONAPI.Entity -public typealias BasicEntity = Entity +public typealias BasicEntity = Entity -public typealias NewEntity = JSONAPI.Entity +public typealias NewEntity = JSONAPI.Entity diff --git a/Tests/JSONAPITests/Attribute/Attribute+FunctorTests.swift b/Tests/JSONAPITests/Attribute/Attribute+FunctorTests.swift index a87f72a..4386d9f 100644 --- a/Tests/JSONAPITests/Attribute/Attribute+FunctorTests.swift +++ b/Tests/JSONAPITests/Attribute/Attribute+FunctorTests.swift @@ -37,7 +37,7 @@ class Attribute_FunctorTests: XCTestCase { // MARK: Test types extension Attribute_FunctorTests { - enum TestTypeDescription: EntityDescription { + enum TestTypeDescription: ResourceObjectDescription { public static var jsonType: String { return "test" } public struct Attributes: JSONAPI.Attributes { diff --git a/Tests/JSONAPITests/Computed Properties/ComputedPropertiesTests.swift b/Tests/JSONAPITests/Computed Properties/ComputedPropertiesTests.swift index 9131adb..c7ebbf4 100644 --- a/Tests/JSONAPITests/Computed Properties/ComputedPropertiesTests.swift +++ b/Tests/JSONAPITests/Computed Properties/ComputedPropertiesTests.swift @@ -45,7 +45,7 @@ class ComputedPropertiesTests: XCTestCase { // MARK: Test types extension ComputedPropertiesTests { - public enum TestTypeDescription: EntityDescription { + public enum TestTypeDescription: ResourceObjectDescription { public static var jsonType: String { return "test" } public struct Attributes: JSONAPI.Attributes { diff --git a/Tests/JSONAPITests/Custom Attributes Tests/CustomAttributesTests.swift b/Tests/JSONAPITests/Custom Attributes Tests/CustomAttributesTests.swift index 91c46bd..7d6e8f0 100644 --- a/Tests/JSONAPITests/Custom Attributes Tests/CustomAttributesTests.swift +++ b/Tests/JSONAPITests/Custom Attributes Tests/CustomAttributesTests.swift @@ -39,7 +39,7 @@ class CustomAttributesTests: XCTestCase { // MARK: - Test Types extension CustomAttributesTests { - enum CustomAttributeEntityDescription: EntityDescription { + enum CustomAttributeEntityDescription: ResourceObjectDescription { public static var jsonType: String { return "test1" } public struct Attributes: JSONAPI.Attributes { @@ -57,7 +57,7 @@ extension CustomAttributesTests { typealias CustomAttributeEntity = BasicEntity - enum CustomKeysEntityDescription: EntityDescription { + enum CustomKeysEntityDescription: ResourceObjectDescription { public static var jsonType: String { return "test1" } public struct Attributes: JSONAPI.Attributes { diff --git a/Tests/JSONAPITests/Document/DocumentTests.swift b/Tests/JSONAPITests/Document/DocumentTests.swift index 7107323..83d6fff 100644 --- a/Tests/JSONAPITests/Document/DocumentTests.swift +++ b/Tests/JSONAPITests/Document/DocumentTests.swift @@ -1094,7 +1094,7 @@ extension DocumentTests { // MARK: - Test Types extension DocumentTests { - enum AuthorType: EntityDescription { + enum AuthorType: ResourceObjectDescription { static var jsonType: String { return "authors" } typealias Attributes = NoAttributes @@ -1103,7 +1103,7 @@ extension DocumentTests { typealias Author = BasicEntity - enum ArticleType: EntityDescription { + enum ArticleType: ResourceObjectDescription { static var jsonType: String { return "articles" } typealias Attributes = NoAttributes diff --git a/Tests/JSONAPITests/Entity/EntityTests.swift b/Tests/JSONAPITests/Entity/EntityTests.swift index ab75f07..467fba7 100644 --- a/Tests/JSONAPITests/Entity/EntityTests.swift +++ b/Tests/JSONAPITests/Entity/EntityTests.swift @@ -646,7 +646,7 @@ extension EntityTests { // MARK: - Test Types extension EntityTests { - enum TestEntityType1: EntityDescription { + enum TestEntityType1: ResourceObjectDescription { static var jsonType: String { return "test_entities"} typealias Attributes = NoAttributes @@ -655,7 +655,7 @@ extension EntityTests { typealias TestEntity1 = BasicEntity - enum TestEntityType2: EntityDescription { + enum TestEntityType2: ResourceObjectDescription { static var jsonType: String { return "second_test_entities"} typealias Attributes = NoAttributes @@ -667,7 +667,7 @@ extension EntityTests { typealias TestEntity2 = BasicEntity - enum TestEntityType3: EntityDescription { + enum TestEntityType3: ResourceObjectDescription { static var jsonType: String { return "third_test_entities"} typealias Attributes = NoAttributes @@ -679,7 +679,7 @@ extension EntityTests { typealias TestEntity3 = BasicEntity - enum TestEntityType4: EntityDescription { + enum TestEntityType4: ResourceObjectDescription { static var jsonType: String { return "fourth_test_entities"} struct Relationships: JSONAPI.Relationships { @@ -701,7 +701,7 @@ extension EntityTests { typealias TestEntity4WithMetaAndLinks = Entity - enum TestEntityType5: EntityDescription { + enum TestEntityType5: ResourceObjectDescription { static var jsonType: String { return "fifth_test_entities"} typealias Relationships = NoRelationships @@ -713,7 +713,7 @@ extension EntityTests { typealias TestEntity5 = BasicEntity - enum TestEntityType6: EntityDescription { + enum TestEntityType6: ResourceObjectDescription { static var jsonType: String { return "sixth_test_entities" } typealias Relationships = NoRelationships @@ -727,7 +727,7 @@ extension EntityTests { typealias TestEntity6 = BasicEntity - enum TestEntityType7: EntityDescription { + enum TestEntityType7: ResourceObjectDescription { static var jsonType: String { return "seventh_test_entities" } typealias Relationships = NoRelationships @@ -740,7 +740,7 @@ extension EntityTests { typealias TestEntity7 = BasicEntity - enum TestEntityType8: EntityDescription { + enum TestEntityType8: ResourceObjectDescription { static var jsonType: String { return "eighth_test_entities" } typealias Relationships = NoRelationships @@ -758,7 +758,7 @@ extension EntityTests { typealias TestEntity8 = BasicEntity - enum TestEntityType9: EntityDescription { + enum TestEntityType9: ResourceObjectDescription { public static var jsonType: String { return "ninth_test_entities" } typealias Attributes = NoAttributes @@ -781,7 +781,7 @@ extension EntityTests { typealias TestEntity9 = BasicEntity - enum TestEntityType10: EntityDescription { + enum TestEntityType10: ResourceObjectDescription { public static var jsonType: String { return "tenth_test_entities" } typealias Attributes = NoAttributes @@ -794,7 +794,7 @@ extension EntityTests { typealias TestEntity10 = BasicEntity - enum TestEntityType11: EntityDescription { + enum TestEntityType11: ResourceObjectDescription { public static var jsonType: String { return "eleventh_test_entities" } public struct Attributes: JSONAPI.Attributes { @@ -806,7 +806,7 @@ extension EntityTests { typealias TestEntity11 = BasicEntity - enum UnidentifiedTestEntityType: EntityDescription { + enum UnidentifiedTestEntityType: ResourceObjectDescription { public static var jsonType: String { return "unidentified_test_entities" } struct Attributes: JSONAPI.Attributes { @@ -824,7 +824,7 @@ extension EntityTests { typealias UnidentifiedTestEntityWithMetaAndLinks = NewEntity - enum TestEntityWithMetaAttributeDescription: EntityDescription { + enum TestEntityWithMetaAttributeDescription: ResourceObjectDescription { public static var jsonType: String { return "meta_attribute_entity" } struct Attributes: JSONAPI.Attributes { @@ -840,7 +840,7 @@ extension EntityTests { typealias TestEntityWithMetaAttribute = BasicEntity - enum TestEntityWithMetaRelationshipDescription: EntityDescription { + enum TestEntityWithMetaRelationshipDescription: ResourceObjectDescription { public static var jsonType: String { return "meta_relationship_entity" } typealias Attributes = NoAttributes diff --git a/Tests/JSONAPITests/Includes/IncludeTests.swift b/Tests/JSONAPITests/Includes/IncludeTests.swift index b3920ba..7f8f0f8 100644 --- a/Tests/JSONAPITests/Includes/IncludeTests.swift +++ b/Tests/JSONAPITests/Includes/IncludeTests.swift @@ -192,7 +192,7 @@ extension IncludedTests { // MARK: - Test types extension IncludedTests { - enum TestEntityType: EntityDescription { + enum TestEntityType: ResourceObjectDescription { typealias Relationships = NoRelationships @@ -206,7 +206,7 @@ extension IncludedTests { typealias TestEntity = BasicEntity - enum TestEntityType2: EntityDescription { + enum TestEntityType2: ResourceObjectDescription { public static var jsonType: String { return "test_entity2" } @@ -222,7 +222,7 @@ extension IncludedTests { typealias TestEntity2 = BasicEntity - enum TestEntityType3: EntityDescription { + enum TestEntityType3: ResourceObjectDescription { typealias Attributes = NoAttributes @@ -236,7 +236,7 @@ extension IncludedTests { typealias TestEntity3 = BasicEntity - enum TestEntityType4: EntityDescription { + enum TestEntityType4: ResourceObjectDescription { typealias Attributes = NoAttributes @@ -247,7 +247,7 @@ extension IncludedTests { typealias TestEntity4 = BasicEntity - enum TestEntityType5: EntityDescription { + enum TestEntityType5: ResourceObjectDescription { typealias Attributes = NoAttributes @@ -258,7 +258,7 @@ extension IncludedTests { typealias TestEntity5 = BasicEntity - enum TestEntityType6: EntityDescription { + enum TestEntityType6: ResourceObjectDescription { typealias Attributes = NoAttributes @@ -271,7 +271,7 @@ extension IncludedTests { typealias TestEntity6 = BasicEntity - enum TestEntityType7: EntityDescription { + enum TestEntityType7: ResourceObjectDescription { typealias Attributes = NoAttributes @@ -282,7 +282,7 @@ extension IncludedTests { typealias TestEntity7 = BasicEntity - enum TestEntityType8: EntityDescription { + enum TestEntityType8: ResourceObjectDescription { typealias Attributes = NoAttributes @@ -293,7 +293,7 @@ extension IncludedTests { typealias TestEntity8 = BasicEntity - enum TestEntityType9: EntityDescription { + enum TestEntityType9: ResourceObjectDescription { typealias Attributes = NoAttributes diff --git a/Tests/JSONAPITests/NonJSONAPIRelatable/NonJSONAPIRelatableTests.swift b/Tests/JSONAPITests/NonJSONAPIRelatable/NonJSONAPIRelatableTests.swift index cb32d69..6a78d40 100644 --- a/Tests/JSONAPITests/NonJSONAPIRelatable/NonJSONAPIRelatableTests.swift +++ b/Tests/JSONAPITests/NonJSONAPIRelatable/NonJSONAPIRelatableTests.swift @@ -52,7 +52,7 @@ class NonJSONAPIRelatableTests: XCTestCase { // MARK: - Test Types extension NonJSONAPIRelatableTests { - enum TestEntityDescription: EntityDescription { + enum TestEntityDescription: ResourceObjectDescription { static var jsonType: String { return "test" } typealias Attributes = NoAttributes @@ -65,7 +65,7 @@ extension NonJSONAPIRelatableTests { typealias TestEntity = JSONAPI.Entity - enum TestEntity2Description: EntityDescription { + enum TestEntity2Description: ResourceObjectDescription { static var jsonType: String { return "test" } typealias Attributes = NoAttributes diff --git a/Tests/JSONAPITests/Poly/PolyProxyTests.swift b/Tests/JSONAPITests/Poly/PolyProxyTests.swift index 2a20f1c..29dca66 100644 --- a/Tests/JSONAPITests/Poly/PolyProxyTests.swift +++ b/Tests/JSONAPITests/Poly/PolyProxyTests.swift @@ -65,7 +65,7 @@ public class PolyProxyTests: XCTestCase { // MARK: - Test types public extension PolyProxyTests { - enum UserDescription1: EntityDescription { + enum UserDescription1: ResourceObjectDescription { public static var jsonType: String { return "users" } public struct Attributes: JSONAPI.Attributes { @@ -76,7 +76,7 @@ public extension PolyProxyTests { public typealias Relationships = NoRelationships } - enum UserDescription2: EntityDescription { + enum UserDescription2: ResourceObjectDescription { public static var jsonType: String { return "users" } public struct Attributes: JSONAPI.Attributes { @@ -124,7 +124,7 @@ extension Poly2: EntityProxy, JSONTyped where A == PolyProxyTests.UserA, B == Po return .none } - public enum SharedUserDescription: EntityProxyDescription { + public enum SharedUserDescription: ResourceObjectProxyDescription { public static var jsonType: String { return A.jsonType } public struct Attributes: Equatable { diff --git a/Tests/JSONAPITests/Poly/PolyTests.swift b/Tests/JSONAPITests/Poly/PolyTests.swift index b12d860..0662ba0 100644 --- a/Tests/JSONAPITests/Poly/PolyTests.swift +++ b/Tests/JSONAPITests/Poly/PolyTests.swift @@ -569,7 +569,7 @@ extension PolyTests { // MARK: - Test types extension PolyTests { - enum TestEntityType: EntityDescription { + enum TestEntityType: ResourceObjectDescription { typealias Relationships = NoRelationships @@ -583,7 +583,7 @@ extension PolyTests { typealias TestEntity = BasicEntity - enum TestEntityType2: EntityDescription { + enum TestEntityType2: ResourceObjectDescription { public static var jsonType: String { return "test_entity2" } @@ -599,7 +599,7 @@ extension PolyTests { typealias TestEntity2 = BasicEntity - enum TestEntityType3: EntityDescription { + enum TestEntityType3: ResourceObjectDescription { typealias Attributes = NoAttributes @@ -613,7 +613,7 @@ extension PolyTests { typealias TestEntity3 = BasicEntity - enum TestEntityType4: EntityDescription { + enum TestEntityType4: ResourceObjectDescription { typealias Attributes = NoAttributes @@ -624,7 +624,7 @@ extension PolyTests { typealias TestEntity4 = BasicEntity - enum TestEntityType5: EntityDescription { + enum TestEntityType5: ResourceObjectDescription { typealias Attributes = NoAttributes @@ -635,7 +635,7 @@ extension PolyTests { typealias TestEntity5 = BasicEntity - enum TestEntityType6: EntityDescription { + enum TestEntityType6: ResourceObjectDescription { typealias Attributes = NoAttributes @@ -648,7 +648,7 @@ extension PolyTests { typealias TestEntity6 = BasicEntity - enum TestEntityType7: EntityDescription { + enum TestEntityType7: ResourceObjectDescription { typealias Attributes = NoAttributes @@ -659,7 +659,7 @@ extension PolyTests { typealias TestEntity7 = BasicEntity - enum TestEntityType8: EntityDescription { + enum TestEntityType8: ResourceObjectDescription { typealias Attributes = NoAttributes @@ -670,7 +670,7 @@ extension PolyTests { typealias TestEntity8 = BasicEntity - enum TestEntityType9: EntityDescription { + enum TestEntityType9: ResourceObjectDescription { typealias Attributes = NoAttributes diff --git a/Tests/JSONAPITests/Relationships/RelationshipTests.swift b/Tests/JSONAPITests/Relationships/RelationshipTests.swift index eec8179..0a17f12 100644 --- a/Tests/JSONAPITests/Relationships/RelationshipTests.swift +++ b/Tests/JSONAPITests/Relationships/RelationshipTests.swift @@ -172,7 +172,7 @@ extension RelationshipTests { // MARK: - Test types extension RelationshipTests { - enum TestEntityType1: EntityDescription { + enum TestEntityType1: ResourceObjectDescription { typealias Attributes = NoAttributes typealias Relationships = NoRelationships diff --git a/Tests/JSONAPITests/ResourceBody/ResourceBodyTests.swift b/Tests/JSONAPITests/ResourceBody/ResourceBodyTests.swift index a1e3b2e..ed73e60 100644 --- a/Tests/JSONAPITests/ResourceBody/ResourceBodyTests.swift +++ b/Tests/JSONAPITests/ResourceBody/ResourceBodyTests.swift @@ -101,7 +101,7 @@ class ResourceBodyTests: XCTestCase { XCTAssertEqual(combined.values, body1.values + body2.values) } - enum ArticleType: EntityDescription { + enum ArticleType: ResourceObjectDescription { public static var jsonType: String { return "articles" } typealias Relationships = NoRelationships diff --git a/Tests/JSONAPITests/Test Helpers/EntityTestTypes.swift b/Tests/JSONAPITests/Test Helpers/EntityTestTypes.swift index 23e6b7d..fe059c0 100644 --- a/Tests/JSONAPITests/Test Helpers/EntityTestTypes.swift +++ b/Tests/JSONAPITests/Test Helpers/EntityTestTypes.swift @@ -7,8 +7,8 @@ import JSONAPI -public typealias Entity = JSONAPI.Entity +public typealias Entity = JSONAPI.Entity -public typealias BasicEntity = Entity +public typealias BasicEntity = Entity -public typealias NewEntity = JSONAPI.Entity +public typealias NewEntity = JSONAPI.Entity