Skip to content

Commit

Permalink
Rename SwaggerUi3 to SwaggerUi
Browse files Browse the repository at this point in the history
  • Loading branch information
RicoSuter committed Dec 13, 2023
1 parent d5447f2 commit 948b389
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/NSwag.AspNet.Owin/NSwag.AspNet.Owin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<Compile Include="..\NSwag.AspNetCore\OAuth2ClientSettings.cs" Link="OAuth2ClientSettings.cs" />
<Compile Include="..\NSwag.AspNetCore\ReDocSettings.cs" Link="ReDocSettings.cs" />
<Compile Include="..\NSwag.AspNetCore\SwaggerSettings.cs" Link="SwaggerSettings.cs" />
<Compile Include="..\NSwag.AspNetCore\SwaggerUiSettings.cs" Link="SwaggerUi3Settings.cs" />
<Compile Include="..\NSwag.AspNetCore\SwaggerUiSettings.cs" Link="SwaggerUiSettings.cs" />
<Compile Include="..\NSwag.AspNetCore\SwaggerUiSettingsBase.cs" Link="SwaggerUiSettingsBase.cs" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static IApplicationBuilder UseSwaggerUi(
foreach (var document in documents)
{
var swaggerRoute = swaggerRouteWithPlaceholder.Replace("{documentName}", document.DocumentName);
settings.SwaggerRoutes.Add(new SwaggerUi3Route(document.DocumentName, swaggerRoute));
settings.SwaggerRoutes.Add(new SwaggerUiRoute(document.DocumentName, swaggerRoute));
}
return true;
Expand Down
14 changes: 7 additions & 7 deletions src/NSwag.AspNetCore/SwaggerUiSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ public bool WithCredentials
}

/// <summary>Gets or sets the Swagger URL routes (must start with '/', hides SwaggerRoute).</summary>
public ICollection<SwaggerUi3Route> SwaggerRoutes { get; } = new List<SwaggerUi3Route>();
public ICollection<SwaggerUiRoute> SwaggerRoutes { get; } = new List<SwaggerUiRoute>();

/// <summary>Gets or sets the Swagger URL routes factory (SwaggerRoutes is ignored when set).</summary>
#if AspNetOwin
public Func<IOwinRequest, CancellationToken, Task<IEnumerable<SwaggerUi3Route>>> SwaggerRoutesFactory { get; set; }
public Func<IOwinRequest, CancellationToken, Task<IEnumerable<SwaggerUiRoute>>> SwaggerRoutesFactory { get; set; }
#else
public Func<HttpRequest, CancellationToken, Task<IEnumerable<SwaggerUi3Route>>> SwaggerRoutesFactory { get; set; }
public Func<HttpRequest, CancellationToken, Task<IEnumerable<SwaggerUiRoute>>> SwaggerRoutesFactory { get; set; }
#endif

internal override string ActualSwaggerDocumentPath => SwaggerRoutes.Any() ? "" : base.ActualSwaggerDocumentPath;
Expand Down Expand Up @@ -165,7 +165,7 @@ internal override async Task<string> TransformHtmlAsync(string html, HttpRequest
? "undefined"
: JsonConvert.SerializeObject(
#pragma warning disable 618
swaggerRoutes.Select(r => new SwaggerUi3Route(r.Name,
swaggerRoutes.Select(r => new SwaggerUiRoute(r.Name,
TransformToExternalPath(r.Url.Substring(MiddlewareBasePath?.Length ?? 0), request)))
#pragma warning restore 618
));
Expand All @@ -188,10 +188,10 @@ internal override async Task<string> TransformHtmlAsync(string html, HttpRequest
}

/// <summary>Specifies a route in the Swagger dropdown.</summary>
public class SwaggerUi3Route
public class SwaggerUiRoute
{
/// <summary>Initializes a new instance of the <see cref="SwaggerUi3Route"/> class.</summary>
public SwaggerUi3Route(string name, string url)
/// <summary>Initializes a new instance of the <see cref="SwaggerUiRoute"/> class.</summary>
public SwaggerUiRoute(string name, string url)
{
if (string.IsNullOrWhiteSpace(name))
{
Expand Down

0 comments on commit 948b389

Please sign in to comment.