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

How do I specify an optional field when accepting multipart-params for a request? #460

Open
amokfa opened this issue Apr 16, 2024 · 0 comments

Comments

@amokfa
Copy link

amokfa commented Apr 16, 2024

Library Version(s)

2.0.0-alpha31

Problem

(POST "/test-route" request
     :multipart-params [optional_data :- s/Str]
     :middleware [admin-rbac upload/wrap-multipart-params]
     (res/ok "ok"))

In this example, optional_data is not a mandatory argument. How do I tell the framework to accept requests which do not provide this field. I've tried these and they don't work:

...
:multipart-params [optional_data :- s/Str nil]
...
...
:multipart-params [optional_data :- (s/maybe s/Str)]
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant