Skip to content

0.20.4

Compare
Choose a tag to compare
@Deraen Deraen released this 26 May 11:09
· 1179 commits to master since this release
  • response descriptions can be given also with run-time meta-data (with-meta), fixes #96
    • in next MINOR version, we'll switch to (Ring-)Swagger 2.0 format.
(context* "/responses" []
  :tags ["responses"]
  (GET* "/" []
    :query-params [return :- (s/enum :200 :403 :404)]
    :responses    {403 ^{:message "spiders?"} {:code s/Str} ; old
                   404 (with-meta {:reason s/Str} {:message "lost?"})} ; new
    :return       Total
    :summary      "multiple returns models"
    (case return
      :200 (ok {:total 42})
      :403 (forbidden {:code "forest"})
      :404 (not-found {:reason "lost"}))))