Add `@json` special parameter for http json bodies
Closed this issue · 0 comments
jamillosantos commented
Like @request
, @client
, @session
, add a @json
special parameter at the routes definition.
This new special parameter will accept bodies as JSON
try to parse it and if fails calls the controller with a Json::nullValue as value.
Route file:
GET / controllers::index::def(@json)
Controller:
namespace controller
{
class index
{
icarus::result def(Json::Value json) // JSON parsed
{
// ...
}
}
}