Fork me on GitHub
#ring-swagger
<
2017-01-12
>
assoc-in01:01:36

I am attempting to have two swagger endpoints in my project so two separate defapi calls and when I have A before B in my compojure.routes/routes function A works perfectly, but B fails on calls with a body with "errors": "(not (map? nil))" . If I put B before A then the same happens to A. It looks like somewhere the input from the response is being deleted before the next swagger api can process it. Is this expected behavior?

ikitommi10:01:03

@assoc-in, sadly the clojure immutable meets the mutable java, described in here: https://github.com/metosin/compojure-api/wiki/Serving-static-resources#caveats

ikitommi10:01:21

... with 1.2.*, the top-level mw is muuntaja.middleware/wrap-format

ikitommi10:01:35

@sickill the linked wiki page actually describes the options to serve static sites. Didn't remember that. There could be a more batteries-included top-level route with own options and acting as a single route root, which could have static pages, multiple apis & web sockets under it. api is also a Route-record, so it can act already as subroute.