-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FormData parameters of type 'file' get sent as 'System.Byte[]' instead of the buffer contents. #59
Comments
@baronfel Thank you for so detailed description. |
I'll try and create a repro in just a bit, but I'm operating from a hand crafter swagger.yaml so I'll have to go research how swashbuckle expects controller actions that represent file data to look. |
I've taken some more time on this tonight, and it seems that the blocker is that FSharp.Data.Http doesn't support multipart data at all. I'm working on that to unblock this feature. The Issue on that repo is fsprojects/FSharp.Data#811. It's a big one though :( |
@baronfel do you alternatives for |
I suppose the leading contenders would be System.Net.HttpClient, which I've used before for multipart content, and also Haf's Httpfs. I can see of either of those are profile 259 compliant |
Should be addressed by #131 in OpenApiClientProvider |
Description
Given an operation that has a parameter of type 'file' whose location is 'formData', the resulting Request logic correctly makes a BodyType of FormData, but the coerceString method taked the Expr representing the byte[] parameter and calls
Object.ToString()
on it, resulting in the bad representation.We should either expand the
coerceString
function in OperationCompiler.fs to understand the differencedefType
s, or find a way to use the ByteArrayConverter to reduce code duplications.Repro steps
Expected behavior
The byte array contents should appear in the body in the form
foo=XXXXX
, where XXXX are the bytes.Actual behavior
The result is
file=System.Byte[]
Known workarounds
None
Related information
The text was updated successfully, but these errors were encountered: