Internal helpers shared across transformers, verifiers, and Info modules.
These functions consolidate logic that was previously duplicated across
AshPhoenixGenApi.Transformers.* and AshPhoenixGenApi.Verifiers.*.
Summary
Functions
Extracts a value from a Spark.InfoGenerator accessor result.
Formats a source annotation as a "Defined at" suffix for error messages.
Returns a list of human-readable problems with an MFA tuple.
Checks whether a value has the shape of a valid MFA tuple
{module, function, args} where module and function are atoms
and args is a list.
Functions
Extracts a value from a Spark.InfoGenerator accessor result.
Spark.InfoGenerator generates two versions of each accessor:
gen_api_foo/1returns{:ok, value}or:errorgen_api_foo!/1returns the value or raises- Predicate functions (ending with
?) return the value directly
This helper unwraps the {:ok, value} tuple, falls back to the provided
default when the option is not configured (:error), and passes through
direct values (for predicate functions).
Formats a source annotation as a "Defined at" suffix for error messages.
Supports tuple ({line, column}), property-list, and other annotation
shapes produced by :erl_anno. Returns an empty string when no usable
annotation is available.
Returns a list of human-readable problems with an MFA tuple.
Used by verifiers to explain exactly which parts of the tuple are invalid.
Checks whether a value has the shape of a valid MFA tuple
{module, function, args} where module and function are atoms
and args is a list.