schema.coercer
Jump to function (3) ›
schema.coercer/coerce#
(coerce schema value)
Walks schema and returns value with string-typed inputs coerced into their schema-required types. Already-typed values pass through. Unknown or untranslatable values are returned unchanged so validation can report the real failure.
Example:
(coerce :int "42") ; => 42
schema.coercer/conform#
(conform schema value)
Coerces value against schema. Returns the coerced value if it then validates, otherwise the invalid marker :phel.schema/invalid.
Example:
(conform :int "42") ; => 42
schema.coercer/invalid-marker#
Sentinel keyword returned by coercion when a value cannot be coerced to the target schema. Re-exported as phel.schema/invalid-marker.