PhoenixSpec.ParamsExtractor (PhoenixSpec v0.1.1)

View Source

Extracts request body schemas from Phoenix controller actions.

Detects patterns like:

  • Pattern matching %{"key" => value} in function args
  • Ecto.Changeset.cast(struct, params, [:field1, :field2]) in controller or schema changeset
  • Wrapper key nesting (e.g. %{"post" => post_params} wraps fields under "post")

Summary

Functions

Extracts parameter info from a controller module's source. Returns a map of action names to their ParamsInfo.

Functions

extract(controller)

@spec extract(module()) :: %{required(atom()) => struct()}

Extracts parameter info from a controller module's source. Returns a map of action names to their ParamsInfo.