mirror of
https://github.com/encounter/JSONAPI.git
synced 2026-03-30 11:18:38 -07:00
Add test helpers for Open API test target
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// EntityTestTypes.swift
|
||||
// JSONAPITests
|
||||
//
|
||||
// Created by Mathew Polzin on 11/15/18.
|
||||
//
|
||||
|
||||
import JSONAPI
|
||||
|
||||
public typealias Entity<Description: JSONAPI.EntityDescription, Meta: JSONAPI.Meta, Links: JSONAPI.Links> = JSONAPI.Entity<Description, Meta, Links, String>
|
||||
|
||||
public typealias BasicEntity<Description: JSONAPI.EntityDescription> = Entity<Description, NoMetadata, NoLinks>
|
||||
|
||||
public typealias NewEntity<Description: JSONAPI.EntityDescription, Meta: JSONAPI.Meta, Links: JSONAPI.Links> = JSONAPI.Entity<Description, Meta, Links, Unidentified>
|
||||
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// String+CreatableRawIdType.swift
|
||||
// JSONAPITests
|
||||
//
|
||||
// Created by Mathew Polzin on 11/12/18.
|
||||
//
|
||||
|
||||
import JSONAPI
|
||||
|
||||
private var uniqueStringCounter = 0
|
||||
|
||||
extension String: CreatableRawIdType {
|
||||
public static func unique() -> String {
|
||||
uniqueStringCounter += 1
|
||||
return String(uniqueStringCounter)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user