Open
Description
What is the problem this feature would solve?
One might accept file uploads in a route like so:
({ body: t.Object({ files: t.Files() }) })
This will (naturally) only work with the "multipart/form-data" format. But this also makes it lose JSON-specific features, such as this, which might be necessary in some scenarios:
({
body: t.Object({
files: t.Files(),
subObject: t.Object({ example: t.String() }) // you can never set the value of "example", i tried
})
})
What is the feature you are proposing to solve the problem?
What if "sub-objects" (or arrays) under the body
object were parsed as a JSON string (and checked against the type) when the request uses multipart/form-data?
What alternatives have you considered?
I can run JSON.parse()
myself of course, but it wouldn't automatically work with the type checking system, and I'd have to do it manually.