struct Athena::Routing::Converters::RequestBody(T, P)
- Athena::Routing::Converters::RequestBody(T, P)
- Struct
- Value
- Object
Overview
Resolves the request body into type T
.
Defined in:
routing/converters.crrouting/ext/granite.cr
Constructors
Class Method Summary
-
.convert(ctx : HTTP::Server::Context, body : String) : T
Special override for Granite ORM to check for existence of a record, and set the deserialized model as not a new record.
Instance Method Summary
Constructor Detail
Class Method Detail
def self.convert(ctx : HTTP::Server::Context, body : String) : T
#
Special override for Granite ORM to check for existence of a record, and set the deserialized model as not a new record. Will also handle non Granite classes.
Will check the given record exists on PUT, returning a 404 error if it does not exist, or primary_key is not provided.