PgRest.TypeCaster (PgRest v0.1.0)

Copy Markdown View Source

Casts string values from URL parameters to proper Elixir/Ecto types based on schema introspection.

Summary

Functions

Casts all filter values to their proper types based on the schema. Returns {:ok, filters} with cast values or {:error, reason} on cast failure.

Functions

cast_filters(filters, schema_module)

@spec cast_filters([map()], module()) :: {:ok, [map()]} | {:error, term()}

Casts all filter values to their proper types based on the schema. Returns {:ok, filters} with cast values or {:error, reason} on cast failure.