struct
JSONAPI::ResourceInput
- JSONAPI::ResourceInput
- Struct
- Value
- Object
Overview
Validated input resource extracted from an incoming JSON:API request body.
Defined in:
jsonapi/deserializer.crConstructors
Instance Method Summary
- #attribute(name : String) : JSON::Any
- #attribute?(name : String) : JSON::Any | Nil
- #attributes : Hash(String, JSON::Any)
-
#attributes_as(klass : T.class) : T forall T
Maps
#attributesinto aJSON::SerializableCrystal struct or class. - #id : String | Nil
- #relationship_id(name : String) : String | Nil
- #relationship_ids(name : String) : Array(String)
- #relationships : Hash(String, RelationshipInput)
- #type : String
Constructor Detail
def self.new(type : String, id : String | Nil = nil, attributes : Hash(String, JSON::Any) = Hash(String, JSON::Any).new, relationships : Hash(String, RelationshipInput) = Hash(String, RelationshipInput).new)
#
Instance Method Detail
Maps #attributes into a JSON::Serializable Crystal struct or class.