-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
File upload support is currently partially/incorrectly documented #1183
Comments
@mikebeaton makes sense. If you want to go ahead and create a PR for the docs update I'll be happy to merge. Thx |
Is this really just a documentation issue and not a bug? I was stuck on this problem for two days now and i was only able to solve it by "trial-and-error", when i eventually removed the [FromForm] attribute from the IFormFile parameter. |
@dernop - while it may not prevent your API from working, it's technically incorrect to decorate While the type and the attribute sound related, they're actually expressing two different concepts. The This distinction is aptly captured in the The fact that the API still behaves as you expect, even with the incorrect use of the attribute, is an issue you should take up with ASP.NET Core team. Swashbuckle depends heavily on the metadata that's surfaced from ASP.NET Core, and if that metadata states that the model is deserialized from form-fields as opposed to binary data, then that's how Swashbuckle will describe it. |
…re (#9000) * Aspnetcore fix file parameters domaindrivendev/Swashbuckle.AspNetCore#1183 (comment) * Update Samples * Add Consumes to Controller. Needed for correct swashbuckle * Add bodyParam annotation again * Add InputFormatterStream * Selective Use of IFormFIle * Update samples * Add missing List * Fix duplicate consumes * Update samples * Remove executable bit * Add missing files * Add Comments
Hi,
Would a PR adding (very brief) documentation for the file upload support be welcomed?
At the moment:
It would simplify tracking down how to use file uploads if that small piece of text in the README was removed.
IFormFile
is indeed now supported by this project, with a clean file upload button, but this does not work if theIFormFile
is marked[FromForm]
, which is counterintuitive (to me, at least!)With
IformFile file
parameter:With
[FromForm]IFormFile file
parameter:It would be helpful if the requirement not to tag
IFormFile
with[FromForm]
was documented, since I guess (?!) that this is something that maybe not just I am going to try by mistake. (At the same time, having this info, very briefly, would serve the additional purpose of clarifying what the user has to do to get a file upload up and running, right in the README.)Does that sound sensible? Thanks!
The text was updated successfully, but these errors were encountered: