question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for array in form data request body

See original GitHub issue

Describe the solution you’d like

Practically, form data allows duplicate keys, and servers may parse them as an array (See https://stackoverflow.com/a/28434829).

One of our API requires such a parameter, but the generated requester doesn’t support this usage.

From the above StackOverflow answer, different servers may behave differently, so maybe some extra investigations are required. For our backend written in PHP, the parameter name must end with [].

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ferdikoomencommented, Nov 29, 2021

@yume-chan I published a new version 0.12.4, that should now support basic array types. Issue https://github.com/ferdikoomen/openapi-typescript-codegen/issues/772 is still valid

0reactions
yume-chancommented, Dec 7, 2021

Thanks! I have verified it works for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can I append an array to 'formdata' in javascript?
I'm using FormData to upload files.
Read more >
FormData append javascript array (JSON.stringify ... - Laracasts
I'm using Vue/ inertia, to submit a javascript array to be stored as JSON in my DB. Because I'm submitting files in the...
Read more >
Sending an array as form-data - Help - Postman community
You can send an array in form-data by using the same name for multiple keys, and putting values in each one. Please see...
Read more >
Using FormData Objects - Web APIs | MDN
The FormData object lets you compile a set of key/value pairs to send using XMLHttpRequest . It is primarily intended for use in...
Read more >
Send Array as Part of x-www-form-urlencoded Using Postman
To use the x-www-form-urlencoded type in Postman, we need to select the radio button with the same name within the request's body tab....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found