2019-01-24 17:25:34 -08:00
|
|
|
//
|
2019-01-25 11:59:05 -08:00
|
|
|
// JSONAPI+Sampleable.swift
|
2019-01-24 17:25:34 -08:00
|
|
|
// JSONAPIOpenAPI
|
|
|
|
|
//
|
|
|
|
|
// Created by Mathew Polzin on 1/24/19.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
import JSONAPI
|
|
|
|
|
|
|
|
|
|
extension NoAttributes: Sampleable {
|
|
|
|
|
public static var sample: NoAttributes {
|
|
|
|
|
return .none
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extension NoRelationships: Sampleable {
|
|
|
|
|
public static var sample: NoRelationships {
|
|
|
|
|
return .none
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extension NoMetadata: Sampleable {
|
|
|
|
|
public static var sample: NoMetadata {
|
|
|
|
|
return .none
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extension NoLinks: Sampleable {
|
|
|
|
|
public static var sample: NoLinks {
|
|
|
|
|
return .none
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extension NoAPIDescription: Sampleable {
|
|
|
|
|
public static var sample: NoAPIDescription {
|
|
|
|
|
return .none
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extension UnknownJSONAPIError: Sampleable {
|
|
|
|
|
public static var sample: UnknownJSONAPIError {
|
|
|
|
|
return .unknownError
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-25 11:59:05 -08:00
|
|
|
extension Unidentified: Sampleable {
|
|
|
|
|
public static var sample: Unidentified {
|
|
|
|
|
return Unidentified()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-24 17:25:34 -08:00
|
|
|
extension Attribute: Sampleable where RawValue: Sampleable {
|
|
|
|
|
public static var sample: Attribute<RawValue> {
|
|
|
|
|
return .init(value: RawValue.sample)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extension SingleResourceBody: Sampleable where Entity: Sampleable {
|
|
|
|
|
public static var sample: SingleResourceBody<Entity> {
|
|
|
|
|
return .init(entity: Entity.sample)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extension ManyResourceBody: Sampleable where Entity: Sampleable {
|
|
|
|
|
public static var sample: ManyResourceBody<Entity> {
|
|
|
|
|
return .init(entities: Entity.samples)
|
|
|
|
|
}
|
|
|
|
|
}
|