Add an CLI option --emitFormData, which will emit export type RequestBody = FormData; when body content type is multipart/form-data.
For environments which aren't support FormData (i.e. Node) it can be fixed by adding --header option, which will insert custom content at the top of generated file (--header='import FormData from "form-data";')
Having a schema like this:
Expected output:
Actual output:
Suggested solution
Add an CLI option
--emitFormData
, which will emitexport type RequestBody = FormData;
when body content type ismultipart/form-data
.For environments which aren't support FormData (i.e. Node) it can be fixed by adding
--header
option, which will insert custom content at the top of generated file (--header='import FormData from "form-data";'
)