Fork me on GitHub

I just realized reitit can do coercion based on the given spec. The examples I have read usually centers around simple spec coercion, e.g. integer? will try to parse given string value to integer. So how do you actually attach a custom coercer? I'm trying to coerce a base64 string from :path-params into a UUID using spec coercion.


if uuid? doesn't work for you, you can attach a custom decode function into spec like the doc @U662GKS3F pointed.


Thank you


Is the "pretty error messages" feature for developers (i.e. for reitit configuration errors) or for users (i.e. invalid parameters sent in a request, or an exception in the handler)?


@aaron51 pretty errors are for developers, all that ansi-printing is not very fast. You can intercept the paremeter errors (for users) and plug in something there too. Here’s example how to use expound with spec messages: