#5553·scalar

select multiple files

Author: ekristenCreated May 2, 2025Updated Jun 23, 2026
Labelsbugpackage: @scalar/api-clientsending requests

What happens?

This might happen in other places but I have for sure confirmed this with multipart/form.

I have an endpoint that has a property files with type as array. This gets rendered as files[0] in the scalar UI which is wrong.

Image

It should be files.

The curl statement is even generated incorrectly beyond getting the field wrong, it sends a JSON payload with a multipart/form-data which is not right. It should use the -F option on curl.

However it does seem to send multipart/form-data PROPERLY when clicking send, so it's just a curl generation that's wrong.

bash
curl http://localhost:4242/api/v1/files/upload \
  --request POST \
  --header 'Content-Type: multipart/form-data' \
  --data '{
  "files[0]": "test.txt",
  "owner_id": "01JT76N7T4PSSE646454MHDSCM",
  "owner_type": "case"
}'

What did you expect to happen?

I expect the multipart form to be files not files[0]. Swagger UI gets this right.

Swagger generates the CURL statement correct as well

bash
curl -X 'POST' \
  'http://localhost:4242/api/v1/files/upload' \
  -H 'accept: */*' \
  -H 'x-api-key: test' \
  -H 'Content-Type: multipart/form-data' \
  -F '[email protected];type=text/plain' \
  -F '[email protected];type=text/plain' \
  -F 'owner_id=01JT76N7T4PSSE646454MHDSCM' \
  -F 'owner_type=case'

Image

OpenAPI Document

No response