I'm a clojure beginner. I recently began a API project (based on Luminus) to help me learn Clojure.
I love the fact that there is support for Swagger out of the box. I have a question regarding how to represent (in swagger) a POST request body which takes in a limited set of values for one property.
Eg: A user can send to the API end point these keys
So far I have this code and struggling with how to define the group property, would appreciate any help here.
(:require [schema.core :as s])
(s/defschema Member {
:name string?,
:admin boolean?
:group string?})
["/add-member"
{:post {:summary "add a new member"
:parameters {:body Member}
:tags ["term"]
:response {200 {:body map?}}
:handler (fn [{{{:keys [name admin group]} :body} :parameters}]
{:status 200
:body {:success 1 ;; code talks to db here
}}]