You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use axios and generate a formData object to pass a file on the request like so:
import FormData from 'form-data';
const formData = new FormData();
formData.append('file', <file buffer>, <file name>);
The getFormData code intercepts this and creates a new formData object that axios attempts to use, but it throws an error trying to read the name of the file. Over-riding this code to simply return options.formData resolves this. It's not really clear why getFormData is manipulating the inbound formData object in the first place, is this necessary?
The text was updated successfully, but these errors were encountered:
Check out our fork of this repository @hey-api/openapi-ts. We have fixed this issue in v0.32.1. If you run into any further issues, open an issue in our repository. Thanks.
openapi-typescript-codegen/src/templates/core/functions/getFormData.hbs
Line 2 in e2d6be1
We're using
openapi-typescript-codegen
on a project and one of ourPUT
endpoints has the followingrequestBody
spec:We use
axios
and generate aformData
object to pass a file on the request like so:The
getFormData
code intercepts this and creates a newformData
object thataxios
attempts to use, but it throws an error trying to read the name of the file. Over-riding this code to simply returnoptions.formData
resolves this. It's not really clear whygetFormData
is manipulating the inboundformData
object in the first place, is this necessary?The text was updated successfully, but these errors were encountered: