Skip to content

Commit

Permalink
Use name "Swagger" more and switch to use IOptions<T> for middleware
Browse files Browse the repository at this point in the history
- move `PostProcess` document from `SwaggerDocumentSettings` to `SwaggerMiddlewareOptions`
  - adjust `SwaggerDocumentProvider` to match, breaking some `IDocumentProvider` scenarios (!!)
- rename a few classes to use "Swagger" more
- split extensions into type-specific classes with appropriate namespaces
- fix `SwaggerMiddlewareOptions.SwaggerRoute` being invalid from a Microsoft.AspNetCore.Routing perspective
- change `SwaggerBuilderExtensions` to support creating documents with `SchemaType.OpenApi3` default
- change `SwaggerApplicationBuilderExtensions` to
  - split `UseSwagger(...)` from `UseSwaggerReDocUi(...)` and `UseSwaggerUi4(...)`
  - add UI middleware supporting a single `documentName`

"Reviewers:" comments ask make suggestions for future improvements / extensions and ask for better names
  • Loading branch information
dougbu committed Oct 24, 2018
1 parent 429e3bd commit 2f71924
Show file tree
Hide file tree
Showing 17 changed files with 739 additions and 376 deletions.
34 changes: 0 additions & 34 deletions src/NSwag.AspNetCore/AspNetCoreToOpenApiMiddlewareSettings.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
//-----------------------------------------------------------------------
// <copyright file="IOpenApiBuilder.cs" company="NSwag">
// <copyright file="ISwaggerBuilder.cs" company="NSwag">
// Copyright (c) Rico Suter. All rights reserved.
// </copyright>
// <license>https://github.com/NSwag/NSwag/blob/master/LICENSE.md</license>
// <author>Rico Suter, mail@rsuter.com</author>
//-----------------------------------------------------------------------

using Microsoft.Extensions.DependencyInjection;

namespace NSwag.AspNetCore.DependencyInjection
namespace Microsoft.Extensions.DependencyInjection
{
/// <summary>
/// An interface for configuring Open Api documents.
/// An interface for configuring Swagger and Open API documents.
/// </summary>
public interface IOpenApiBuilder
public interface ISwaggerBuilder
{
/// <summary>
/// Gets the <see cref="IServiceCollection"/>.
Expand Down
Loading

0 comments on commit 2f71924

Please sign in to comment.