Open
Description
Description
When hey-api converts a body payload into a form for multipart/form-data
, nested arrays with one element lose their distinction as nested upon serialization. Instead, they look like the unnested data type. It is due to this code (and its equivalent for other backends):
openapi-ts/packages/client-axios/src/utils.ts
Line 498 in 7098555
When only one value exists, the form has no indication to wrap the inner element as a list and instead treats it as a single list
Reproducible example or configuration
- Ensure fastapi is installed with python >=3.10 as the server (optional, only to verify the 422 unprocessible entity error)
- Ensure npm packages are available (provided in the zip for node 22.5.1)
- Execute
./run_frontend_backend.sh
and open localhost:5173 in browser - Click the button and observe the POST data is incorrectly formatted (list[int] is created, not list[list[int]])
To regenerate the hey-api client api, ensure the fastapi server is running (it provides the openapi file), and run npx openapi-ts
OpenAPI specification (optional)
3.1.1
System information (optional)
macos
Activity