Library to extend Swashbuckle.AspNetCore
Install the package Vernou.Swashbuckle :
dotnet add package Vernou.Swashbuckle
In Swashbuckle, Operation Filters can modify the operation in the Open Api Specification generated.
This library has many operation filters that you can use like :
builder.Services
.AddSwaggerGen(options =>
{
...
options.OperationFilter<AutomaticBadRequest>();
});
The operation filter AutomaticBadRequest
add a bad request response with the schema ValidationProblemDetails
to operations generated from an controller action that had a parameter and can return a automatic bad request.
More information about automatic bad request in the Microsoft documentation :