-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[rust-server] Drop file
support
#547
Conversation
typeMapping.put("File", "Box<Stream<Item=Vec<u8>, Error=Error> + Send>"); | ||
typeMapping.put("file", "Box<Stream<Item=Vec<u8>, Error=Error> + Send>"); | ||
typeMapping.put("File", "swagger::ByteArray"); | ||
typeMapping.put("file", "swagger::ByteArray"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For other generators, we're also mapping file
and binary
to the same type.
Withdrawing - we need to retain support for transferring large files in some form. |
Re-opening as per #538 (comment). The apparent former support for asynchronous file transfer wasn't actually asynchronous (we still buffered the whole file in memory). Thus, we lose nothing by removing the file mechanism now. We can defer the problem of large file transfer until someone actually needs the feature. |
6d9ad9d
to
c6ffb12
Compare
Totally agree. |
In swagger v2, we had 'binary', 'byte', and 'file'. OpenAPI v3 only has the former two. This commit drops the old 'file' handling. This has the side-effect of removing a half-complete implementation of form parameter handling. This removes the ability to send files as streams, so will make life harder for those wishing to send large files without running out of memory.
c6ffb12
to
dc77c10
Compare
I'm currently busy sorting out the merge conflicts. Once that's done, I'd like to give this a day to give people an opportunity to object to the overall plan. Assuming nobody objects, then will then be ready to merge. Copying in the technical committee - @frol @farcaller |
file
supportfile
support
OK - we've not had any objections. On that basis, I think this is now ready to be merged (modulo anyone wanting to review this?) |
I'll merge it this weekend if no further question/feedback on this change. cc @frol @farcaller |
* [rust-server] drop 'file' support In swagger v2, we had 'binary', 'byte', and 'file'. OpenAPI v3 only has the former two. This commit drops the old 'file' handling. This has the side-effect of removing a half-complete implementation of form parameter handling. This removes the ability to send files as streams, so will make life harder for those wishing to send large files without running out of memory. * Remove all remaining uses of `hasFile`
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.master
,3.1.x
,4.0.x
. Default:master
.Description of the PR
In swagger v2, we had 'binary', 'byte', and 'file'. OpenAPI v3 only has
the former two. This commit drops the old 'file' handling. This has the
side-effect of removing a half-complete implementation of form parameter handling.
This removes the ability to send files as streams, so will make life
harder for those wishing to send large files without running out of
memory.
See #307 and #538 for the motivation behind this PR.