I've been working on some code to generate reitit routes based on malli schemas, and wanted to write some tests to make sure the schema checking/coercion is done properly.
We've hit a snag though, where I don't actually seem to get a coercer from compile-request-coercers, just a nil, so calling coerce! just returns a nil as well.
Is it just breaking because of the lack of a handler function in the route map? Or am I missing something else? I've more or less copied the docs' examples verbatim here.
I've been working on some code to generate reitit routes based on malli schemas, and wanted to write some tests to make sure the schema checking/coercion is done properly.
We've hit a snag though, where I don't actually seem to get a coercer from
compile-request-coercers
, just anil
, so callingcoerce!
just returns a nil as well.We generate a set of routes that looks like this:
Turn it into a router like so:
Now according to the docs, if I match on one of these paths I should get a coercer under the
:result
key in the match but ... I don't.So calling
coerce!
just returnsnil
, and the following test fails.Is it just breaking because of the lack of a handler function in the route map? Or am I missing something else? I've more or less copied the docs' examples verbatim here.