Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validate_length break the pipeline #25

Open
Bogdan1001 opened this issue Dec 22, 2021 · 1 comment
Open

validate_length break the pipeline #25

Bogdan1001 opened this issue Dec 22, 2021 · 1 comment

Comments

@Bogdan1001
Copy link

Hello,

    input_with_wrong_types  = %{id: "1231", email: 12312, password: 32_423_423}

    input_with_wrong_types
    |> Justify.validate_required([:id, :email, :password])
    |> Justify.validate_type(:id, :non_neg_integer)
    |> Justify.validate_type(:email, :string)
    |> Justify.validate_type(:password, :string)
    |> Justify.validate_length(:email, min: 2)

By building a pipeline like so the validation will break with Error on validate_length stage, but we do expect to get a struct to parse the error later the same way as ecto changesets do, so the struct should be back on validate_type stage.

@anthonator
Copy link
Contributor

Can you provide the error you’re getting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants