Commit c1b22ef
committed
fix: handle arrays properly in FormData
When FormData contains arrays (e.g., multiple file uploads), the current
implementation incorrectly stringifies the entire array instead of
appending each item individually.
This fix:
- Detects when a property is an array
- Iterates through each array item
- Properly appends each file/blob individually to FormData
- Preserves non-file array items by JSON.stringify-ing them individually
This enables proper multi-file uploads and array handling in FormData,
which is essential for APIs that accept multiple attachments or files.1 parent 291d9de commit c1b22ef
File tree
30 files changed
+1320
-920
lines changed- templates/base/http-clients
- tests
- __snapshots__
- fixtures
- spec
- another-query-params/__snapshots__
- custom-extensions/__snapshots__
- defaultAsSuccess/__snapshots__
- defaultResponse/__snapshots__
- deprecated/__snapshots__
- dot-path-params/__snapshots__
- enumNamesAsValues/__snapshots__
- enumNotFirstInComponents/__snapshots__
- extractRequestBody/__snapshots__
- extractRequestParams/__snapshots__
- extractResponseBody/__snapshots__
- extractResponseError/__snapshots__
- jsAxios/__snapshots__
- jsonapi-media-type/__snapshots__
- moduleNameFirstTag/__snapshots__
- moduleNameIndex/__snapshots__
- on-insert-path-param/__snapshots__
- operationId-starting-with-number/__snapshots__
- patch/__snapshots__
- responses/__snapshots__
- singleHttpClient/__snapshots__
- sortTypes-false/__snapshots__
- sortTypes/__snapshots__
- typeSuffixPrefix/__snapshots__
- unionEnums/__snapshots__
30 files changed
+1320
-920
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
124 | 122 | | |
125 | 123 | | |
126 | 124 | | |
| |||
0 commit comments