Skip to content

Feature Request: Put functions in the schema valuesΒ #25

@SkipMike

Description

@SkipMike

I love this library, but I almost never build my own changeset validation functions because it's too cumbersome. I usually just use with after using params validation for types.

However, I think that it would be awesome if we could put validation functions in the schema. Could we somehow detect those and build a changeset validation out of functions, as long as they have the right call signature?

defparams asdf %{
  x!: fn :x, x -> is_integer(x) and x > 0 end,
  y!: :string,
}

This would satisfy the other 20% of api validation that I need. I'm happy to take a stab at this, if you guys think that it's feasible and desirable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions