azure-functions-extensions-swashbuckle icon indicating copy to clipboard operation
azure-functions-extensions-swashbuckle copied to clipboard

Added ability to configure options from extension method.

Open colinbull opened this issue 4 years ago • 3 comments

@yuka1984

The PR adds the ability to be able to configure the SwaggerGen options and the Swashbuckle options from the extension method call. It follows the same pattern as most of the .net core ecosystem, this I think fixes #15. For example:

public void Configure(IWebJobsBuilder builder)
{
    //Register the extension
    builder.AddSwashBuckle(Assembly.GetExecutingAssembly(), opts =>
    {
        opts.OpenApiSpec = OpenApiSpecVersion.OpenApi3_0;
        opts.Documents = new OptionDocument[]
        {
            new OptionDocument { Description = "Custom Generated By Swashbuckle", Name = "v1", Title = "Test API", Version = "v1.1.10"},
        };
        opts.Title = "Hello";
        opts.FillSwaggerBasePathWithRoutePrefix = false;
        opts.SwaggerConfigurator = s =>
        {
            s.SchemaFilter<TestController.TypeExcludeFilter>(new TestController.TypeExcludeFilter.Options(typeof(IModelValidator)));
        };
    });

It also brings the Swagger packages and references up to the latest version. This was required due to some changes in Swagger moving to the OpenAPI spec

I have also fixed a few bugs:

  1. Incorrect swagger base route. #38
  2. Ability to configure OpenAPI spec writer #35
  3. Display Examples #30

image

  1. Support for .NET Core 3 and functions v3 #29 #21

colinbull avatar Apr 11 '20 16:04 colinbull

It'd be great to get it merged, what do you think @yuka1984?

miszu avatar Apr 25 '20 17:04 miszu

This would be great

rbev avatar Jul 01 '20 05:07 rbev

It'd be great to get it merged, what do you think @yuka1984?

tommy-grovnes avatar Sep 22 '20 08:09 tommy-grovnes