Skip to content

Default validation transformers are too loose #54

Description

@jfexyz

Currently yup's validation and cast behavior for booleans seems way too greedy: https://tonicdev.com/joshuajabbour/yup-greedy-cast Even with the strict flag, the results are counter-intuitive. Ultimately, I think most people will need to overwrite the default transformer.

Personally, I think the boolean transformer should be more restrictive, and only accept true, false, 'true', 'false', 1, 0, '1', '0'. At the very least, the docs need to detail that 'whatever1' === true, etc. (All the types need transformer documentation actually.)

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