Fork me on GitHub

Hi folks, what’s the best idiom to make showing the browsable Swagger API configurable? I.e. if a var show-swagger-api is true, then will show the nice, human-friendly API console AND serve all the REST endpoints of my app; but if my var show-swagger-api is false, then it WON’T show the API console — but it will still serve all the REST endpoints. Thanks in advance!


(I do not intend to mutate show-swagger-api except by setting environment variables prior to executing the Clojure program)


@eigenhombre: in c-api, api-options are just data and you can manipulate those freely. Something like: (api {:swagger {:ui (if show-swagger-api "/api-docs"), :spec "/swagger.json"}} ...)


thanks @ikitommi ! I forgot that the API changed to make that sort of thing trivial.