Vernou.Swashbuckle.HttpResultsAdapter is a NuGet package that extend Swashbuckle.AspNetCore to generate Open Api responses to action that returns type from the namespace Microsoft.AspNetCore.Http.HttpResult
.
.NET 7 introduce Typed Http Results, but Swashbuckle don't generate the Open Api Response from this types.\
See this issue for more detail :
TypedResults metadata are not inferred for API Controllers
Install the package Vernou.Swashbuckle.HttpResultsAdapter :
dotnet add package Vernou.Swashbuckle.HttpResultsAdapter
Add the operation filter like :
builder.Services
.AddSwaggerGen(options =>
{
...
options.OperationFilter<HttpResultsOperationFilter>();
});
Enjoy convenient Typed Http Results.
This project welcomes contributions and suggestions.
Vernou.Swashbuckle.HttpResultsAdapter is licensed under the MIT license.