ring-swagger

ring-swagger & compojure-api
borkdude 2018-02-22T19:48:38.000225Z

I am updating some Schemas on the fly, but Schemas defined with s/defschema don’t reflect these updates in the swagger UI. Is there some magic happening in ring-swagger where they refer back to the original var using the metadata maybe?

juhoteperi 2018-02-22T19:50:33.000067Z

@borkdude Which routing lib is this?

borkdude 2018-02-22T19:50:40.000545Z

I’m using yada.

juhoteperi 2018-02-22T19:51:13.000629Z

Compojure-api stores the data on routing handler (which is a record).

juhoteperi 2018-02-22T19:52:00.000231Z

Not sure about yada, but I think the Schemas aren't usually referred using vars but directly

borkdude 2018-02-22T19:53:25.000176Z

yeah, the weird thing is when I remove the metadata explicitly, it works

borkdude 2018-02-22T19:53:43.000297Z

but then I lose the name in the swagger UI

borkdude 2018-02-22T19:55:42.000230Z

I made a hack which uses alter-var-root… but it’s kind of a mystery to me why this happens

borkdude 2018-02-22T20:07:01.000003Z

Hmm, forget what I said. The problem is with just one of those named Schemas, not all of them.

borkdude 2018-02-22T20:10:26.000213Z

One specific Schema that doesn’t reflect my changes when I assoc another key into it. When I turn s/defschema into def it does work…

borkdude 2018-02-22T21:01:18.000658Z

it is accepted in a request though, just not displayed in the swagger UI example

j0ni 2018-02-22T21:29:10.000417Z

Is there any way to "whitelist" a route so that the middleware defined at the top level is not applied?