I have implemented endpoint with this signature
[HttpPost("Test")]
public IActionResult MyTest([Required] IFormFile pdf, [Required] IFormFile image)
{
// some stuff...
return Ok();
}
this generates following entry in swagger.json (the relevant part)
"content": {
"multipart/form-data": {
"schema": {
"required": [
"image",
"pdf"
],
"type": "object",
"properties": {
"pdf": {
"type": "string",
"format": "binary"
},
"image": {
"type": "string",
"format": "binary"
}
}
},
"encoding": {
"pdf": {
"style": "form"
},
"image": {
"style": "form"
}
}
}
}
but, I also need specify encoding, like in the specs (v3). So for my task, that JSON should look like this, I think...
"encoding": {
"pdf": {
"style": "form",
"contentType": "application/pdf"
},
"image": {
"style": "form",
"contentType": "image/png, image/jpeg"
}
}
But how can I do that from code? I thought about SwaggerParameter attribute, but it contains only description and required flag...
I'm using Swashbuckle.AspNetCore NuGeT package (version 5.0.0-rc2) on .NET Core 2.2.