Warm tip: This article is reproduced from stackoverflow.com, please click
clojure swagger compojure-api

Query Parameter description in ring-swagger

发布于 2020-04-17 12:27:18

I'm using ring-swagger via compojure-api. I have a few query parameters and I'm struggling to find a way to add a description to a single query parameter. I can add the summary of the entire endpoint but that's not enough.

Is it possible to add a swagger description to a single query parameter using ring-swagger/compojure-api?

Questioner
siltalau
Viewed
64
siltalau 2020-02-07 15:17

compojure.api.sweet/describe.

For example:

(GET "/hello" []
  :query-params [name :- (describe String "This is the swagger description for the parameter")]
  (ok {:message (str "Hello, " name)}))