ring-swagger & compojure-api
mgrbyte 2019-05-21T15:24:19.022400Z

Am trying to figure out the letk syntax for optional body params (but within sweet/resource). Stumbled accross this https://github.com/metosin/compojure-api/issues/154 and found the docs - but can't find an example of destructuring :body-params in the resource case, anyone know if it's possible?

ikitommi 2019-05-21T16:14:34.026100Z

@mgrbyte resource is all data, so the fnk can only be used in destructuring, not in declaring parameters. So, you need to declare the optionality via :parameters. Example here: https://github.com/metosin/compojure-api/blob/master/test/compojure/api/resource_test.clj#L43-L47

mgrbyte 2019-05-22T09:44:34.026500Z

Thanks @ikitommi - i had seen this, but looks like it's for schema not spec (can't find an/figure out the equivalent spec example)