This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-05-16
Channels
- # announcements (1)
- # babashka (13)
- # beginners (33)
- # calva (26)
- # cherry (33)
- # clerk (5)
- # clj-kondo (3)
- # clojure (40)
- # clojure-europe (24)
- # clojure-finland (2)
- # clojure-norway (29)
- # clojurescript (18)
- # cursive (2)
- # datomic (6)
- # docker (11)
- # emacs (12)
- # events (1)
- # fulcro (71)
- # graalvm (8)
- # hyperfiddle (2)
- # lsp (23)
- # meander (5)
- # off-topic (36)
- # polylith (4)
- # re-frame (6)
- # reitit (13)
- # shadow-cljs (87)
- # spacemacs (1)
- # tools-deps (19)
- # vim (5)
- # xtdb (57)
Maybe you are getting the error message for the first option? What happens if you switch their order?
Yes that’s exactly it, if I switch the order I get a better error message. The thing is the data could be either of these two and I would like the most detailed error message, rather than the invalid type one…
I’ve never used multischemas so can’t advise there. But perhaps you could iterate over the options and explain each one of them.
Very good question!
ha yes that's probably enough tbh
in my specific case the issue was a time object where a string was expected
I think I can make it work with a multi-schema, but I wonder if there is a larger misunderstanding I have
maybe there’s an option to explain ?
Is :conflicting
supposed to be an invalid key in a route by default?
I get this invalid route error when creating the router. I can alter the spec so its valid but I just want to check if it should be allowed as a default key or if I'm missing something else
What version are you using? https://github.com/metosin/reitit/blob/master/modules/reitit-core/src/reitit/spec.cljc#L43
I'm using "0.7.0-alpha3". It looked to me like its using these default values but I'm not too familiar with the code: https://github.com/metosin/reitit/blob/0b6ed627382ea6bd571e22317fb09555a2a850b4/modules/reitit-ring/src/reitit/ring/spec.cljc#L22 My ring/router configuration in case its helpful
(ring/router
(routes component)
{;; :reitit.middleware/transform dev/print-request-diffs ;; Uncomment to log each middleware's changes
:conflicts log-conflicting-routes
:validate rrs/validate
:reitit.spec/wrap spell/closed
:exception pretty/exception
:reitit.coercion/parameter-coercion strict-query-params-parameter-coercion
:data {:coercion reitit.coercion.schema/coercion
:muuntaja m/instance
:middleware [;; Middleware is called in descending ↓ order
openapi/openapi-feature
parameters/parameters-middleware
muuntaja/format-negotiate-middleware
muuntaja/format-response-middleware
middleware/log-and-return-exceptions-middleware
muuntaja/format-request-middleware
middleware/coerce-request-exceptions-middleware
ring-coercion/coerce-request-middleware
multipart/multipart-middleware]}}))