-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Allow model types to be of type=file #694
Comments
I think currently (with OpenAPI 2.0) you would simply define several form parameters, one of which would be the file type one. Does this not work for you? |
Yes, with the OpenAPI 2.0 this would work with flattening the model or pulling out the file parameters to the operation contract. But with this you loose all benefits that you have with models like:
Looking at the API from implementation perspective, it totally makes sense (to me) to have the file upload as part of the data model where you store the related information to the file. |
Thanks. You've given a good idea on how to deal with an existing issue (or a set of issues) and I'll consider that when approaching it. Need to process it some more, but it may be a way to eliminate |
Partially tackling PR: #741 |
File is dead! Long live File. See #878 |
Currently only operation parameters can be of type file but in some scenarios you want to have the file as part of your model. In our API we have 1 input model defined for our operation:
If any model property is of type file, the operation must be called with
multipart/form-data
. An operation could look like this:In the example above, the user would send the following content to upload a file:
As you can see the model properties are accessed via the name of the single multipart boundaries.
The text was updated successfully, but these errors were encountered: