-
-
Notifications
You must be signed in to change notification settings - Fork 494
Open
Description
When using parse: 'arrayBuffer' with a body schema, the generated OpenAPI spec has an empty content object in requestBody:
{
"requestBody": {
"description": "Audio file as binary data",
"content": {},
"required": true
}
}This causes OpenAPI-to-TypeScript generators to infer the body type as undefined.
The switch in src/openapi.ts of @elysiajs/openapi handles text, urlencoded, json, and formdata, but not arrayBuffer. Same root cause as #1720 (which covers parse: 'none').
Reproduction:
const app = new Elysia().post('/upload', ({ body }) => 'ok', {
parse: 'arrayBuffer',
body: t.Any({ description: 'Binary file data' }),
})A possible fix would be adding arrayBuffer as a case mapping to application/octet-stream, and/or a fallback for any unmatched parse mode so this can't recur.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels