Skip to content

validate_length break the pipeline #25

@Bogdan1001

Description

@Bogdan1001

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions