Closed Bl4d3s closed 1 year ago
Hello
I've had a look at your code and this PR looks good.
Just wondering, how do you register a CSV input formatter? In my WebApi3.1-Swashbuckle5
test project, I get this:
Hi,
thanks for the quick review.
I use the following code:
builder.Services.AddControllers(options =>
{
options.InputFormatters.Add(new CsvInputFormatter());
options.OutputFormatters.Add(new CsvOutputFormatter());
});
and the formatters extend from TextInputFormatter
and TextOutputFormatter
respectively.
I'm using net7.0 so do not know if this applies directly to net3.1 as well.
Released https://www.nuget.org/packages/Swashbuckle.AspNetCore.Filters/7.0.12
Thanks for this PR :-)
This commit enables the CSV media type for response as well as request and both a single example and multiple ones.
As a CSV converter has to be manually registered a try catch block is used to catch the formatter not found exception and display a corresponding message in swagger