Data (Array of Objects) Not Properly Serialized in FormData #2064
Labels
bug 🔥
Something isn't working
prioritized 🚚
This issue has been prioritized and will be worked on soon
Description
When using fetch client to send multipart/form-data, arrays of objects included in multipart/form-data requests are not correctly serialized
for example
Example 1 (having more than 1 object):
teamMemberships: [{ userId: 'yh37dt1wfusy79zbax9tqlwi' }, { userId: 'r4vl2q0p4trr0710edspm6qr' },],
Will result in this body (Serialized objects inside the array but the array itself is not)
Example 2 (having only one object in the array):
teamMemberships: [{ userId: 'r4vl2q0p4trr0710edspm6qr' }]
Will result in this body (Serialized object but its not an array anymore)
Expected Behaviour in these cases would be to always receive a serialized array
Reproducible example or configuration
https://stackblitz.com/edit/stackblitz-starters-tn4yru5u?file=app%2Fapi%2F%5BaccountId%5D%2Fteams%2Froute.ts
A demo can be found here, which contains openapi specs file and generated sdk, the output can be seen in the terminal directly after the project setup (logged in the api route located in
app/api/[accountId]/teams/route.ts
)OpenAPI specification (optional)
Can be found in stackblitz
openapi.json
System information (optional)
No response
The text was updated successfully, but these errors were encountered: