Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Body parameters are always an array #684

Open
jdkealy opened this issue May 25, 2024 · 2 comments
Open

Body parameters are always an array #684

jdkealy opened this issue May 25, 2024 · 2 comments
Labels

Comments

@jdkealy
Copy link

jdkealy commented May 25, 2024

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
@opqdonut
Copy link
Member

opqdonut commented Aug 9, 2024

I can't reproduce this. I tried adding your endpoint to examples/ring-spec-swagger, and it works as expected. Could you post a minimal reproduction?

post-accounts

@opqdonut
Copy link
Member

opqdonut commented Aug 9, 2024

Sorry, closed by accident 😇

@opqdonut opqdonut reopened this Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🇰‍🇼 Waiting
Development

No branches or pull requests

2 participants