Fork me on GitHub
Jakub Holý (HolyJak)21:09:42

Hello folks! I would very much appreciate an advice on how to programatically test routing and, most of all, content type negotiation and coercion. I have generated a new Luminus app with +service, which uses swagger, retit, muuntaja etc. This is what I am trying to do, in the generated myapp.handler:

    (require '[jsonista.core :as json])
     {:headers {"accept" "application/json"}
      :uri "/api/employee/start"
      :request-method :post
      :body (ByteArrayInputStream.
                {:first-name "Bo"}))}))
but it fails with > Request coercion failed ... #:clojure.spec.alpha{:problems ({:path [], :pred clojure.core/map?, :val nil, :via [], :in []}) (my handler expects to get a map) So it seems that the body I am trying to send in is somehow ignored and becomes nil. Any tips? /cc @haakon