reitit

https://cljdoc.org/d/metosin/reitit/ https://github.com/metosin/reitit/
areeba 2021-02-19T16:57:11.110900Z

Hello, I have a question that I was hoping to get some help on. I am trying to add Swagger docs to my API. I’m using reitit-swagger and following the docs etc. I have run into a problem with spec and am getting this error when trying to load the swagger.json. This is the error :

java.lang.ClassCastException: class clojure.spec.alpha$every_impl$reify__2264 cannot be cast to class clojure.lang.IPersistentMap (clojure.spec.alpha$every_impl$reify__2264 and clojure.lang.IPersistentMap are in unnamed module of loader 'app')
The spec that seems to be failing is the response part of this endpoint:
["/:portfolio-id/assets" {:patch {:parameters {:path {:portfolio-id ::portfolio/id}
                                                         :body :cue.web.portfolio/add-remove-asset-request}
                                            :responses {200 (s/coll-of :cue/asset)}
                                            :handler web.portfolio/add-remove-assets!}}]
and :cue/asset is a simple map spec. I get a similar error with nil spec :responses {204 nil? 403 nil?} Does anyone have any idea why this might happen and how to fix it ?