mirror of
https://github.com/encounter/JSONAPI.git
synced 2026-03-30 11:18:38 -07:00
trivial refactor in sparse fieldset file
This commit is contained in:
@@ -36,15 +36,12 @@ public struct SparseFieldset<
|
||||
|
||||
public extension ResourceObject where Description.Attributes: SparsableAttributes {
|
||||
|
||||
/// The `SparseFieldset` type for this `ResourceObject`
|
||||
typealias SparseType = SparseFieldset<Description, MetaType, LinksType, EntityRawIdType>
|
||||
|
||||
/// Get a Sparse Fieldset of this `ResourceObject` that can be encoded
|
||||
/// as a `SparsePrimaryResource`.
|
||||
func sparse(with fields: [Description.Attributes.CodingKeys]) -> SparseFieldset<Description, MetaType, LinksType, EntityRawIdType> {
|
||||
func sparse(with fields: [Description.Attributes.CodingKeys]) -> SparseType {
|
||||
return SparseFieldset(self, fields: fields)
|
||||
}
|
||||
}
|
||||
|
||||
public extension ResourceObject where Description.Attributes: SparsableAttributes {
|
||||
|
||||
/// The `SparseFieldset` type for this `ResourceObject`
|
||||
typealias SparseType = SparseFieldset<Description, MetaType, LinksType, EntityRawIdType>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user