Skip to content

parameter coercion can't work with schema validation #194

Description

@igotti

When dealing with an optional boolean parameter, string literals like #{"1" "y" "yes" "on" "true"}) treated as true while #{"0" "n" "no" "off" "false"}) as false and nil for others.
i wrote a function named as-bool to coerce boolean literal refer to Destructuring-Syntax#parameter-coercion , while schema (s/maybe s/Bool) validates the parameter.

Failed the coercion when data binding if the boolean parameter isn't presented and route entirely as per wiki, there is no chance for schema validation comes to play.

Is it more reasonable to accept nil value at data binding and hand route flow over to schema validation at data validating?

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