Multipart dataresponse compatible with swagger.
Hello,
I'm searching for a way to define a multipart dataresponse,
The following controller code accepts multipart formdata.
In the code the fromForm icm with the model that it can receive multipart data.
However, I'm searching how to define this part: [ProducesResponseType(typeof(testResponseModel), StatusCodes.Status200OK)]
So My response can also send multipart data, and swagger will accept it.
To be honest, I do not think it is a standard and is not supported by the defaults
I can define in the testResponseModel to add IFormFile, but swagger does not see it as a multipartform while using FromForm (see request, it is multipart).
Does anyOne know a sollution to respond as a multipart form data where there the metadata and file are multipart
[HttpPost(Name = "SaveFile")]
[ProducesResponseType(typeof(testResponseModel), StatusCodes.Status200OK)]
public async Task<testResponseModel> StoreAsynchronous([FromForm] SaveFileModel request)
{
try
{
return null;
}
catch (Exception ex)
{
throw;
}
}
0 Replies