/Vernou.Swashbuckle.HttpResultsAdapter

Swashbuckle adapter to generate Open Api responses to action that returns HttpResults type

Primary LanguageC#MIT LicenseMIT

Vernou.Swashbuckle.HttpResultsAdapter

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.

Why?

.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

Getting started

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.

Contributing

This project welcomes contributions and suggestions.

License

Vernou.Swashbuckle.HttpResultsAdapter is licensed under the MIT license.