Introspection helpers for AshJsonApi.Resource
Summary
Functions
Returns the argument_names config for the resource: a keyword list, a 2-arity function,
or one of the atoms :camelize / :dasherize (resolved to the corresponding function).
Converts an Ash argument atom name to its JSON:API string key, applying any
argument_names mapping configured on the resource for the given action.
Returns the field_names config for the resource: a keyword list, a 1-arity function,
or one of the atoms :camelize / :dasherize (resolved to the corresponding function).
Converts an Ash atom field name (attribute, calculation, aggregate) to its JSON:API
string key, applying any field_names mapping configured on the resource.
Returns a ref transformer function suitable for the :ref_transformer option of
Ash.Filter.parse_input/3 and Ash.Query.filter_input/3. The returned function maps
user-facing JSON:API field/argument names back to their internal Ash atom names using
the resource's field_names and argument_names configuration.
Converts a JSON:API string key to an Ash argument atom name for the given action,
applying the reverse of any argument_names mapping. Returns nil if not found.
Converts a JSON:API string key to an Ash argument atom name for the given calculation,
applying the reverse of any argument_names mapping. Returns nil if not found.
Converts a JSON:API string key to an Ash atom field name, applying the reverse of any
field_names mapping configured on the resource. Returns nil if not found.
Functions
Returns the argument_names config for the resource: a keyword list, a 2-arity function,
or one of the atoms :camelize / :dasherize (resolved to the corresponding function).
Converts an Ash argument atom name to its JSON:API string key, applying any
argument_names mapping configured on the resource for the given action.
Returns the field_names config for the resource: a keyword list, a 1-arity function,
or one of the atoms :camelize / :dasherize (resolved to the corresponding function).
Converts an Ash atom field name (attribute, calculation, aggregate) to its JSON:API
string key, applying any field_names mapping configured on the resource.
Returns a ref transformer function suitable for the :ref_transformer option of
Ash.Filter.parse_input/3 and Ash.Query.filter_input/3. The returned function maps
user-facing JSON:API field/argument names back to their internal Ash atom names using
the resource's field_names and argument_names configuration.
Converts a JSON:API string key to an Ash argument atom name for the given action,
applying the reverse of any argument_names mapping. Returns nil if not found.
Converts a JSON:API string key to an Ash argument atom name for the given calculation,
applying the reverse of any argument_names mapping. Returns nil if not found.
Converts a JSON:API string key to an Ash atom field name, applying the reverse of any
field_names mapping configured on the resource. Returns nil if not found.