Skip to content

Introduce built-in Ecto validators #3

@imranismail

Description

@imranismail

Parameters should be able to support these declaratively.

I'm thinking along these lines:

params do
  requires :name, :string, only: ~w(john mary)
  requires :profession, :string, except: ~w(student engineer)
  requires :email, :string, matches: ~r/.+@.+/
end

The best place to introduce this is during the schema definition step.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions