ring-swagger

ring-swagger & compojure-api
rbarker 2018-08-20T06:44:37.000100Z

I can’t find any specific documentation that lists all the meta-data that you can explicitly provide when creating an endpoint. The best that I can find is this snippet https://github.com/metosin/compojure-api/wiki/Swagger-integration#just-data We aren’t using Schema or Spec for validation but still want to document the application routes with Swagger and are using compojure-api

ikitommi 2018-08-20T06:52:09.000100Z

@sooheon Tested and your initial code seemwork ok (2.0.0-alpha23)

ikitommi 2018-08-20T06:52:34.000100Z

ikitommi 2018-08-20T06:53:33.000100Z

@rbarker there is (<http://compojure.api.help/help|compojure.api.help/help>) for the repl.

ikitommi 2018-08-20T06:54:05.000100Z

but, if you only need swagger, you can use :swagger for everything.

ikitommi 2018-08-20T06:54:34.000100Z

(GET "/api" []
  :swagger {:description "endpoint", :responses {200 ...}}
  (ok)

rbarker 2018-08-20T06:54:45.000100Z

is there a list of everything that you can put in that map for the :swagger key?

ikitommi 2018-08-20T06:56:15.000100Z

anything that can be set via swagger, here’s the spec: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md

ikitommi 2018-08-20T06:56:38.000100Z

there is a sample in ring-swagger too: https://github.com/metosin/ring-swagger#more-complete-example

ikitommi 2018-08-20T06:57:27.000100Z

the :parameters and :responses can use Schema (or Spec) definitions instead of JSON Schema definitions.

ikitommi 2018-08-20T06:57:57.000100Z

sorry, no guide. happy to see a PR of an example c-api app with just swagger docs.