AshPhoenixGenApi.Verifiers.VerifyDomainConfig
(ash_phoenix_gen_api v1.0.3)
Copy Markdown
View Source
Verifier for the gen_api section of AshPhoenixGenApi.Domain.
This verifier performs compile-time validation of the PhoenixGenApi domain-level configuration. It checks:
Supporter module name — The
supporter_modulemust be a valid Elixir module name (atom).Service configuration — When
define_supporter?istrue, theservicemust be configured.Resource consistency — All resources in the domain that have the
AshPhoenixGenApi.Resourceextension must also have aserviceconfigured in theirgen_apisection. If a resource doesn't have its ownservice, the domain'sservicewill be used as a fallback, so the domain must have one in that case.Request type uniqueness across resources — No two resources in the domain may expose the same
request_typestring. This prevents routing conflicts on the gateway node.Supporter module not already defined — When
define_supporter?istrue, warns if the supporter module already exists (which could indicate a conflict with a manually-defined module).Push nodes configuration — When
push_nodesis configured, validates that it is either a list of atom node names, an MFA tuple{module, function, args},:local, ornil. Lists must contain only atoms, and MFA tuples must have the correct structure.Permission callback configuration — When
permission_callbackis configured, validates that it is either a valid MFA tuple{module, function, args}ornil. MFA tuples must have the correct structure (module and function must be atoms, args must be a list).
Error Messages
The verifier raises Spark.Error.DslError with descriptive messages
and the path to the offending configuration.