reitit

Mia 2024-06-25T20:45:11.962889Z

Hi folks! I'm having a problem with malli schema coercion. I want to use a schema from malli.experimental.time, but we don't have a malli schema registry in the project. We're using reitit with the default coercion setup from the docs: https://github.com/metosin/reitit/blob/master/doc/coercion/malli_coercion.md

nikp 2024-07-03T08:51:59.418119Z

Hey Mia, just a quick one - we tried using this as well with reitit but for some reason get unknown errors on trying to parse "2023-01-01", for example, as a :time/local-date so beware there may be alpha dragons. That said, to add it to the registry you can toss this in when initializing your process

(mr/set-default-registry!
  (mr/composite-registry
    (m/default-schemas)
    (met/schemas)))
With these requires
[malli.core :as m]
[malli.experimental.time :as met]
[malli.registry :as mr]

Mia 2024-06-25T20:46:29.200359Z

I'm getting invalid schema errors because it is trying to find the schema and can't, since it isn't registered

Mia 2024-06-25T20:46:53.160569Z

Is there a place for me to add it to the schema registry in, say, the :options key? What would that look like? Thank you!