I'm trying to write a http post using minimal API in C# NetCore7, that recieves IFormFile file.
MinimalAPI:
var group = app.MapGroup("Payment").WithTags("Payment").WithOpenApi();
group.MapPost("htmlToPdf", async (IFormFile file) =>
{
....
...
}).Accepts<IFormFile>("multipart/form-data");
When I upload the file by using swaggerUI, the file is null:
What am I doing wrong?
The problem was in the following line:
var group = app.MapGroup("Payment").WithTags("Payment").WithOpenApi();
When i removed the following WithOpenAPi()
extension, The uploading file is work properlly!