Fork me on GitHub
#reitit
<
2018-11-23
>
valerauko10:11:38

reitit coercion's throwing weird Assert failed: missing spec predicate errors at me

valerauko10:11:44

have you seen this behavior before?

valerauko10:11:57

i have this on the route

:responses {200 {:body ::oauth-spec/response}}
and the corresponding spec is like
(s/def ::response
  (s/keys :req-un [::id ::client-id ::secret]))
any idea what might be happening?

valerauko10:11:37

never mind upgrading to 0.2.9 fixed it

valerauko11:11:30

this is weird

valerauko11:11:41

request coercion is failing a request

valerauko11:11:06

but there seem to be no problems?

"problems": []

valerauko11:11:30

it's a relatively complex spec, could that be the reason?

valerauko11:11:58

(s/def ::exchange-request
  (s/merge (s/or :code ::exchange-by-code
                 :pass ::exchange-by-auth)
           (s/keys :req-un [::grant-type]
                   :opt-un [::client-id ::client-secret])))

ikitommi12:11:41

@vale would st/merge work? remember that s/merge doesn’t work as expected, by design. could be something else too.

valerauko12:11:05

st as in spec-tools?

ikitommi12:11:22

one way to debug it is to run just (s/confrom ::exchange-request valid-data) and see if it’s in spec.core or spec-tools

valerauko12:11:54

all right i'm gonna try that