ConstructParams.CastDecorator (ConstructParams v0.2.1) View Source

The macro allows casting the incoming controller parameters.

This macro uses the construct library for params validation.

In case of a successful casting, the controller action params are replaced with the casted data. Otherwise the FallbackController is called with {:error, errors} parameters.

Examples

defmodule MyApp.MyController do
  use ConstructParams.CastDecorator

  @decorate cast(MyApp.ConstructCastModule)
  def create(conn, params)
  end
end

Link to this section Summary

Link to this section Functions