Fork me on GitHub
#ring-swagger
<
2020-04-22
>
mrchance06:04:52

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

lambder08:04:17

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?

lambder08:04:09

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

lambder08:04:04

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 ?