Parameter validators for the sync REST API endpoints.
Each validator accepts the raw params map from the Phoenix controller
action, checks that the required fields are present and non-empty, and
returns either {:ok, validated_struct} (with typed field names as
atoms) or {:error, :missing_fields, [String.t()]}.
validate_status_params/1 additionally checks that "status" is one of
"active", "suspended", or "revoked" and returns
{:error, :invalid_status} if not.
Extracted from ApiController in 2026-04 to shrink the controller module
without changing any request/response behavior. The validators are
stateless and have no dependency on Phoenix or Connections — they're
pure param shape checks.
Summary
Functions
Validates a PostgreSQL table identifier: must start with a letter or
underscore and contain only alphanumerics and underscores. Mirrors
SchemaInspector.valid_identifier?/1 but is the entry-point guard the
controller uses before attempting any introspection.
Functions
Validates a PostgreSQL table identifier: must start with a letter or
underscore and contain only alphanumerics and underscores. Mirrors
SchemaInspector.valid_identifier?/1 but is the entry-point guard the
controller uses before attempting any introspection.