Fork me on GitHub
#ring-swagger
<
2017-07-02
>
ikitommi09:07:34

Hi. Heading for summer holidays, but [metosin/compojure-api "2.0.0-alpha5"] is out with swagger-support for spec. 2.0.0 will be finalized after holidays, hopefully in August. There is a small demo-app to play with the spec + swagger: https://github.com/metosin/c2. Blog going out as soon as it’s reviewed.

kennethkalmer10:07:05

Hi folks, I’m trying to use the same metadata handler (via restructure-params) in nested contexts, and it seems only the top-most one has effect. The use case is checking user permissions, which get more granular towards the edges of the routing table…

kennethkalmer10:07:56

I’ve been searching through issues and scouring sample projects and cannot find any hints

kennethkalmer10:07:37

even println‘s in the restructure-params multimethod isn’t getting called for the nested context‘s

kennethkalmer10:07:02

facepalm I figured it out… I break up my different endpoints into separate defapi vars so I can compose them up into the larger routing tree… I had my metadata on defapi, not on a context inside it

kennethkalmer10:07:43

right, so maybe defapi should warn if unknown keys/options are passed through?

ikitommi10:07:13

@kennethkalmer yeah, it should. There could be specs for api options.

kennethkalmer10:07:38

specs ftw 🙂

kennethkalmer10:07:07

I’m under huge time constraints this week, hence Sunday crunch, but I don’t mind taking a stab at it mid-July

kennethkalmer10:07:34

now that I “fixed” it, it was quite a duh moment… took a bit of time though