Skip to content

Instantly share code, notes, and snippets.

@ikitommi
Created January 3, 2014 08:57
Show Gist options
  • Save ikitommi/8234979 to your computer and use it in GitHub Desktop.
Save ikitommi/8234979 to your computer and use it in GitHub Desktop.
Swagger-metadata options
; option1: Liberator-like
(GET "/pizzas" []
:return [Pizza]
:summary "Gets all Pizzas"
:notes "'nuff said."
:nickname "getPizzas"
(response (get-pizzas)))
; option2: as map
(GET "/pizzas" []
{:return [Pizza]
:summary "Gets all Pizzas"
:notes "'nuff said."
:nickname "getPizzas"}
(response (get-pizzas)))
;; allows also:
(def pizzas-doc*
{:return [Pizza]
:summary "Gets all Pizzas"
:notes "'nuff said."
:nickname "getPizzas"}
(GET "/pizzas" [] pizzas-doc*
(response (get-pizzas)))
; option3: meta-data
(^{:return [Pizza]
:summary "Gets all Pizzas"
:notes "'nuff said."
:nickname "getPizzas"}
GET "/pizzas" []
(response (get-pizzas)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment