Skip to content

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

License

Notifications You must be signed in to change notification settings

vernou/Vernou.Swashbuckle.HttpResultsAdapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages