AshTypescript.TypedController.RequestHandler (ash_typescript v0.17.3)

Copy Markdown View Source

Handles request lifecycle for typed controller routes.

Normalizes params (camelCase → snake_case), extracts and casts declared arguments using Ash.Type.cast_input/3, validates required arguments, then dispatches to the route handler (inline fn/2 or module implementing AshTypescript.TypedController.Route).

Only declared arguments are passed to the handler — undeclared params are dropped. If any required argument is missing or any cast fails, a 422 error response is returned without invoking the handler.

Summary

Functions

Handles a route request by extracting, casting, and validating arguments, then dispatching to the configured handler.

Functions

handle(conn, source_module, route_name, params)

Handles a route request by extracting, casting, and validating arguments, then dispatching to the configured handler.