mirror of
https://github.com/encounter/JSONAPI.git
synced 2026-03-30 11:18:38 -07:00
Renamed EntityProxyDescription to ResourceObjectProxyDescription and EntityDescription to ResourceObjectDescription.
This commit is contained in:
+4
-4
@@ -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<Description: EntityDescription> = JSONAPI.Entity<Description, NoMetadata, NoLinks, String>
|
||||
typealias JSONEntity<Description: ResourceObjectDescription> = JSONAPI.Entity<Description, NoMetadata, NoLinks, String>
|
||||
|
||||
// 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<Description: EntityDescription> = JSONAPI.Entity<Description, NoMetadata, NoLinks, Unidentified>
|
||||
typealias UnidentifiedJSONEntity<Description: ResourceObjectDescription> = JSONAPI.Entity<Description, NoMetadata, NoLinks, Unidentified>
|
||||
|
||||
// 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<PrimaryResourceBody: JSONAPI.ResourceBody, IncludeType: JSONA
|
||||
|
||||
// MARK: Entity Definitions
|
||||
|
||||
enum AuthorDescription: EntityDescription {
|
||||
enum AuthorDescription: ResourceObjectDescription {
|
||||
public static var jsonType: String { return "authors" }
|
||||
|
||||
public struct Attributes: JSONAPI.Attributes {
|
||||
@@ -52,7 +52,7 @@ enum AuthorDescription: EntityDescription {
|
||||
|
||||
typealias Author = JSONEntity<AuthorDescription>
|
||||
|
||||
enum ArticleDescription: EntityDescription {
|
||||
enum ArticleDescription: ResourceObjectDescription {
|
||||
public static var jsonType: String { return "articles" }
|
||||
|
||||
public struct Attributes: JSONAPI.Attributes {
|
||||
|
||||
+2
-2
@@ -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<AuthorDescription, EntityMetadata, EntityLinks, String>
|
||||
|
||||
/// Description of an Article entity.
|
||||
enum ArticleDescription: EntityDescription {
|
||||
enum ArticleDescription: ResourceObjectDescription {
|
||||
static var jsonType: String { return "articles" }
|
||||
|
||||
struct Attributes: JSONAPI.Attributes {
|
||||
|
||||
@@ -24,12 +24,12 @@ extension String: CreatableRawIdType {
|
||||
}
|
||||
|
||||
// MARK: - typealiases for convenience
|
||||
public typealias ExampleEntity<Description: EntityDescription> = Entity<Description, NoMetadata, NoLinks, String>
|
||||
public typealias ExampleEntity<Description: ResourceObjectDescription> = Entity<Description, NoMetadata, NoLinks, String>
|
||||
public typealias ToOne<E: Identifiable> = ToOneRelationship<E, NoMetadata, NoLinks>
|
||||
public typealias ToMany<E: Relatable> = ToManyRelationship<E, NoMetadata, NoLinks>
|
||||
|
||||
// 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<DogDescription>
|
||||
|
||||
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" }
|
||||
|
||||
|
||||
@@ -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<EntityDescription>`
|
||||
/// A convenient typealias might make your code much more legible: `One<ResourceObjectDescription>`
|
||||
public struct ToOneRelationship<Identifiable: JSONAPI.Identifiable, MetaType: JSONAPI.Meta, LinksType: JSONAPI.Links>: 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<EntityDescription>`
|
||||
/// A convenient typealias might make your code much more legible: `Many<ResourceObjectDescription>`
|
||||
public struct ToManyRelationship<Relatable: JSONAPI.Relatable, MetaType: JSONAPI.Meta, LinksType: JSONAPI.Links>: RelationshipType, Equatable {
|
||||
|
||||
public let ids: [Relatable.Identifier]
|
||||
|
||||
+8
-8
@@ -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<EntityRawIdType, Self>
|
||||
@@ -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<Description: JSONAPI.EntityDescription, MetaType: JSONAPI.Meta, LinksType: JSONAPI.Links, EntityRawIdType: JSONAPI.MaybeRawId>: EntityType {
|
||||
public struct Entity<Description: JSONAPI.ResourceObjectDescription, MetaType: JSONAPI.Meta, LinksType: JSONAPI.Links, EntityRawIdType: JSONAPI.MaybeRawId>: EntityType {
|
||||
|
||||
public typealias Meta = MetaType
|
||||
public typealias Links = LinksType
|
||||
@@ -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<OkDescription>
|
||||
|
||||
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<OtherOkDescription>
|
||||
|
||||
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<EnumAttributesDescription>
|
||||
|
||||
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<EnumRelationshipsDescription>
|
||||
|
||||
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<BadAttributeDescription>
|
||||
|
||||
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<BadRelationshipDescription>
|
||||
|
||||
enum OptionalArrayAttributeDescription: EntityDescription {
|
||||
enum OptionalArrayAttributeDescription: ResourceObjectDescription {
|
||||
public static var jsonType: String { return "hello" }
|
||||
|
||||
public struct Attributes: JSONAPI.Attributes {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
import JSONAPI
|
||||
|
||||
public typealias Entity<Description: JSONAPI.EntityDescription, Meta: JSONAPI.Meta, Links: JSONAPI.Links> = JSONAPI.Entity<Description, Meta, Links, String>
|
||||
public typealias Entity<Description: JSONAPI.ResourceObjectDescription, Meta: JSONAPI.Meta, Links: JSONAPI.Links> = JSONAPI.Entity<Description, Meta, Links, String>
|
||||
|
||||
public typealias BasicEntity<Description: JSONAPI.EntityDescription> = Entity<Description, NoMetadata, NoLinks>
|
||||
public typealias BasicEntity<Description: JSONAPI.ResourceObjectDescription> = Entity<Description, NoMetadata, NoLinks>
|
||||
|
||||
public typealias NewEntity<Description: JSONAPI.EntityDescription, Meta: JSONAPI.Meta, Links: JSONAPI.Links> = JSONAPI.Entity<Description, Meta, Links, Unidentified>
|
||||
public typealias NewEntity<Description: JSONAPI.ResourceObjectDescription, Meta: JSONAPI.Meta, Links: JSONAPI.Links> = JSONAPI.Entity<Description, Meta, Links, Unidentified>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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<CustomAttributeEntityDescription>
|
||||
|
||||
enum CustomKeysEntityDescription: EntityDescription {
|
||||
enum CustomKeysEntityDescription: ResourceObjectDescription {
|
||||
public static var jsonType: String { return "test1" }
|
||||
|
||||
public struct Attributes: JSONAPI.Attributes {
|
||||
|
||||
@@ -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<AuthorType>
|
||||
|
||||
enum ArticleType: EntityDescription {
|
||||
enum ArticleType: ResourceObjectDescription {
|
||||
static var jsonType: String { return "articles" }
|
||||
|
||||
typealias Attributes = NoAttributes
|
||||
|
||||
@@ -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<TestEntityType1>
|
||||
|
||||
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<TestEntityType2>
|
||||
|
||||
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<TestEntityType3>
|
||||
|
||||
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<TestEntityType4, TestEntityMeta, TestEntityLinks>
|
||||
|
||||
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<TestEntityType5>
|
||||
|
||||
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<TestEntityType6>
|
||||
|
||||
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<TestEntityType7>
|
||||
|
||||
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<TestEntityType8>
|
||||
|
||||
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<TestEntityType9>
|
||||
|
||||
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<TestEntityType10>
|
||||
|
||||
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<TestEntityType11>
|
||||
|
||||
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<UnidentifiedTestEntityType, TestEntityMeta, TestEntityLinks>
|
||||
|
||||
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<TestEntityWithMetaAttributeDescription>
|
||||
|
||||
enum TestEntityWithMetaRelationshipDescription: EntityDescription {
|
||||
enum TestEntityWithMetaRelationshipDescription: ResourceObjectDescription {
|
||||
public static var jsonType: String { return "meta_relationship_entity" }
|
||||
|
||||
typealias Attributes = NoAttributes
|
||||
|
||||
@@ -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<TestEntityType>
|
||||
|
||||
enum TestEntityType2: EntityDescription {
|
||||
enum TestEntityType2: ResourceObjectDescription {
|
||||
|
||||
public static var jsonType: String { return "test_entity2" }
|
||||
|
||||
@@ -222,7 +222,7 @@ extension IncludedTests {
|
||||
|
||||
typealias TestEntity2 = BasicEntity<TestEntityType2>
|
||||
|
||||
enum TestEntityType3: EntityDescription {
|
||||
enum TestEntityType3: ResourceObjectDescription {
|
||||
|
||||
typealias Attributes = NoAttributes
|
||||
|
||||
@@ -236,7 +236,7 @@ extension IncludedTests {
|
||||
|
||||
typealias TestEntity3 = BasicEntity<TestEntityType3>
|
||||
|
||||
enum TestEntityType4: EntityDescription {
|
||||
enum TestEntityType4: ResourceObjectDescription {
|
||||
|
||||
typealias Attributes = NoAttributes
|
||||
|
||||
@@ -247,7 +247,7 @@ extension IncludedTests {
|
||||
|
||||
typealias TestEntity4 = BasicEntity<TestEntityType4>
|
||||
|
||||
enum TestEntityType5: EntityDescription {
|
||||
enum TestEntityType5: ResourceObjectDescription {
|
||||
|
||||
typealias Attributes = NoAttributes
|
||||
|
||||
@@ -258,7 +258,7 @@ extension IncludedTests {
|
||||
|
||||
typealias TestEntity5 = BasicEntity<TestEntityType5>
|
||||
|
||||
enum TestEntityType6: EntityDescription {
|
||||
enum TestEntityType6: ResourceObjectDescription {
|
||||
|
||||
typealias Attributes = NoAttributes
|
||||
|
||||
@@ -271,7 +271,7 @@ extension IncludedTests {
|
||||
|
||||
typealias TestEntity6 = BasicEntity<TestEntityType6>
|
||||
|
||||
enum TestEntityType7: EntityDescription {
|
||||
enum TestEntityType7: ResourceObjectDescription {
|
||||
|
||||
typealias Attributes = NoAttributes
|
||||
|
||||
@@ -282,7 +282,7 @@ extension IncludedTests {
|
||||
|
||||
typealias TestEntity7 = BasicEntity<TestEntityType7>
|
||||
|
||||
enum TestEntityType8: EntityDescription {
|
||||
enum TestEntityType8: ResourceObjectDescription {
|
||||
|
||||
typealias Attributes = NoAttributes
|
||||
|
||||
@@ -293,7 +293,7 @@ extension IncludedTests {
|
||||
|
||||
typealias TestEntity8 = BasicEntity<TestEntityType8>
|
||||
|
||||
enum TestEntityType9: EntityDescription {
|
||||
enum TestEntityType9: ResourceObjectDescription {
|
||||
|
||||
typealias Attributes = NoAttributes
|
||||
|
||||
|
||||
@@ -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<TestEntityDescription, NoMetadata, NoLinks, String>
|
||||
|
||||
enum TestEntity2Description: EntityDescription {
|
||||
enum TestEntity2Description: ResourceObjectDescription {
|
||||
static var jsonType: String { return "test" }
|
||||
|
||||
typealias Attributes = NoAttributes
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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<TestEntityType>
|
||||
|
||||
enum TestEntityType2: EntityDescription {
|
||||
enum TestEntityType2: ResourceObjectDescription {
|
||||
|
||||
public static var jsonType: String { return "test_entity2" }
|
||||
|
||||
@@ -599,7 +599,7 @@ extension PolyTests {
|
||||
|
||||
typealias TestEntity2 = BasicEntity<TestEntityType2>
|
||||
|
||||
enum TestEntityType3: EntityDescription {
|
||||
enum TestEntityType3: ResourceObjectDescription {
|
||||
|
||||
typealias Attributes = NoAttributes
|
||||
|
||||
@@ -613,7 +613,7 @@ extension PolyTests {
|
||||
|
||||
typealias TestEntity3 = BasicEntity<TestEntityType3>
|
||||
|
||||
enum TestEntityType4: EntityDescription {
|
||||
enum TestEntityType4: ResourceObjectDescription {
|
||||
|
||||
typealias Attributes = NoAttributes
|
||||
|
||||
@@ -624,7 +624,7 @@ extension PolyTests {
|
||||
|
||||
typealias TestEntity4 = BasicEntity<TestEntityType4>
|
||||
|
||||
enum TestEntityType5: EntityDescription {
|
||||
enum TestEntityType5: ResourceObjectDescription {
|
||||
|
||||
typealias Attributes = NoAttributes
|
||||
|
||||
@@ -635,7 +635,7 @@ extension PolyTests {
|
||||
|
||||
typealias TestEntity5 = BasicEntity<TestEntityType5>
|
||||
|
||||
enum TestEntityType6: EntityDescription {
|
||||
enum TestEntityType6: ResourceObjectDescription {
|
||||
|
||||
typealias Attributes = NoAttributes
|
||||
|
||||
@@ -648,7 +648,7 @@ extension PolyTests {
|
||||
|
||||
typealias TestEntity6 = BasicEntity<TestEntityType6>
|
||||
|
||||
enum TestEntityType7: EntityDescription {
|
||||
enum TestEntityType7: ResourceObjectDescription {
|
||||
|
||||
typealias Attributes = NoAttributes
|
||||
|
||||
@@ -659,7 +659,7 @@ extension PolyTests {
|
||||
|
||||
typealias TestEntity7 = BasicEntity<TestEntityType7>
|
||||
|
||||
enum TestEntityType8: EntityDescription {
|
||||
enum TestEntityType8: ResourceObjectDescription {
|
||||
|
||||
typealias Attributes = NoAttributes
|
||||
|
||||
@@ -670,7 +670,7 @@ extension PolyTests {
|
||||
|
||||
typealias TestEntity8 = BasicEntity<TestEntityType8>
|
||||
|
||||
enum TestEntityType9: EntityDescription {
|
||||
enum TestEntityType9: ResourceObjectDescription {
|
||||
|
||||
typealias Attributes = NoAttributes
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ extension RelationshipTests {
|
||||
|
||||
// MARK: - Test types
|
||||
extension RelationshipTests {
|
||||
enum TestEntityType1: EntityDescription {
|
||||
enum TestEntityType1: ResourceObjectDescription {
|
||||
typealias Attributes = NoAttributes
|
||||
|
||||
typealias Relationships = NoRelationships
|
||||
|
||||
@@ -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
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user