module Runcobo::Params::Json

Overview

Defines json params.

class JsonParamsExample < BaseAction
  get "/params"
  json NamedTuple(
    id: Int64,
    category: String,
    user: NamedTuple(
      email: String,
      gender: Int32,
    ),
  )

  call do
    sum = params[:user][:gender] + 6
    render_plain "#{sum}: #{category}"
  end
end

Direct including types

Defined in:

runcobo/actions/params/json.cr

Macro Summary

Macro Detail

macro json(code) #

[View source]