metosin / reitit

A fast data-driven routing library for Clojure/Script

Home Page:https://cljdoc.org/d/metosin/reitit/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Body parameters are always an array

jdkealy opened this issue · comments

I can't seem to make any endpoint receive just a regular map. Everything is an array. As you can see, I have a key "test" and swagger UI is showing it as an array. Any idea how to resolve this ?

(def account-handlers
  ["/accounts" {:coercion reitit.coercion.spec/coercion
                :swagger {:tags ["accounts"]}}
   [""
    {:get {:summary "All Accounts"
           :handler accounts-handler}
     :post {:parameters {:body {:test int?}}
            :summary "Create Account"
            :handler create-account-handler}}]])
Screenshot 2024-05-25 at 1 21 09 PM