Skip to content

Commit

Permalink
Fix IDE suggestions
Browse files Browse the repository at this point in the history
Apply code refactoring suggestions from Visual Studio.
  • Loading branch information
martincostello committed May 18, 2024
1 parent a0f4bb4 commit 91c936b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Swashbuckle.AspNetCore.Swagger/SwaggerMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class SwaggerMiddleware
{
_next = next;
_options = options ?? new SwaggerOptions();
_requestMatcher = new TemplateMatcher(TemplateParser.Parse(_options.RouteTemplate), new RouteValueDictionary());
_requestMatcher = new TemplateMatcher(TemplateParser.Parse(_options.RouteTemplate), []);
}

#if !NETSTANDARD
Expand Down
4 changes: 2 additions & 2 deletions src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public async Task Invoke(HttpContext httpContext)
await _staticFileMiddleware.Invoke(httpContext);
}

private StaticFileMiddleware CreateStaticFileMiddleware(
private static StaticFileMiddleware CreateStaticFileMiddleware(
RequestDelegate next,
IWebHostEnvironment hostingEnv,
ILoggerFactory loggerFactory,
Expand All @@ -104,7 +104,7 @@ public async Task Invoke(HttpContext httpContext)
return new StaticFileMiddleware(next, hostingEnv, Options.Create(staticFileOptions), loggerFactory);
}

private void RespondWithRedirect(HttpResponse response, string location)
private static void RespondWithRedirect(HttpResponse response, string location)
{
response.StatusCode = 301;
response.Headers["Location"] = location;
Expand Down
4 changes: 2 additions & 2 deletions src/Swashbuckle.AspNetCore.SwaggerUI/SwaggerUIOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public class ConfigObject
public string ValidatorUrl { get; set; } = null;

[JsonExtensionData]
public Dictionary<string, object> AdditionalItems { get; set; } = new Dictionary<string, object>();
public Dictionary<string, object> AdditionalItems { get; set; } = [];
}

public class UrlDescriptor
Expand Down Expand Up @@ -233,7 +233,7 @@ public class OAuthConfigObject
/// <summary>
/// String array of initially selected oauth scopes, default is empty array
/// </summary>
public IEnumerable<string> Scopes { get; set; } = new string[] { };
public IEnumerable<string> Scopes { get; set; } = [];

/// <summary>
/// Additional query parameters added to authorizationUrl and tokenUrl
Expand Down

0 comments on commit 91c936b

Please sign in to comment.