ring-swagger

ring-swagger & compojure-api
2020-04-22T06:37:52.029800Z

Has anyone seen this error before? java.lang.IllegalStateException: AsyncContext completed and/or Request lifecycle recycled We have a lot of services based on the same compojure-api setup, but only one of them regularly has this error, and we're unsure where it comes from. It looks like it happens when the other side prematurely closes the connection, but catching EofException doesn't seem to prevent it

lambder 2020-04-22T08:30:25.030200Z

Hello ,

lambder 2020-04-22T08:31:17.031200Z

Can't find an example to construct a swagger spec with optional query parameters. They all render required: true in the swagger.json. Any ideas?

lambder 2020-04-22T08:32:09.031600Z

(btw: I use https://github.com/frankiesardo/route-swagger for Pedestal with clojure spec )

lambder 2020-04-22T08:48:04.034500Z

So, to partially answer my own question, thanks to https://github.com/frankiesardo/route-swagger/blob/master/example/src/sample/service.clj example one can instead of naming individual parameters define all the params with schema or spec which is map with optional keys. That works. Follow-up question: Can we get the same behaviour with parameters defined separately (on the routes) and marked them somehow as optional ?