Prevent Files from being converted to JSON in the request? #1679
Unanswered
Leviathan91
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Hi @Leviathan91, are you able to offer a reproducible example/OpenAPI spec? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Using @hey-api/openapi-ts,
when I try to use the generated import methods for an upload excel file function, I can see in the network tab that the request content-length is always 2, I assume that is because it tries to json the file attached in the method invocation, which it cant on a File, so it returns {}.
When I use my swagger-api directly, a file import works. Same if in my frontend instead of calling the generated import method, I use a native fetch call. So I know that the library somehow transforms my request.
But I have found no way how to stop that transformation, there are transform options, but only for dates. And If i enable transformers so i can access them on my methods, all transformers are response transformers, but I need request transformers, since I am targetting the upload request, not it's reponse.
Beta Was this translation helpful? Give feedback.
All reactions