/Vernou.Swashbuckle

Library to extend Swashbuckle.AspNetCore

Primary LanguageC#MIT LicenseMIT

Vernou.Swashbuckle

Library to extend Swashbuckle.AspNetCore

Getting started

Install the package Vernou.Swashbuckle :

dotnet add package Vernou.Swashbuckle

Operation Filters

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>();
    });

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 :