Created
January 3, 2014 08:57
-
-
Save ikitommi/8234979 to your computer and use it in GitHub Desktop.
Swagger-metadata options
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; option1: Liberator-like | |
(GET "/pizzas" [] | |
:return [Pizza] | |
:summary "Gets all Pizzas" | |
:notes "'nuff said." | |
:nickname "getPizzas" | |
(response (get-pizzas))) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; 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))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; 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