Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update frozen Swashbuckle dependency to latest version and remove patched SchemaGenerator #1548

Merged
merged 1 commit into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/usage/openapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ app.UseSwagger(options => options.RouteTemplate = "api-docs/{documentName}/swagg
Instead, always call `UseSwagger()` *without parameters*. To change the route template, use the code below:

```c#
builder.Services.Configure<SwaggerOptions>(options => options.RouteTemplate = "api-docs/{documentName}/swagger.yaml");
builder.Services.Configure<SwaggerOptions>(options => options.RouteTemplate = "/api-docs/{documentName}/swagger.yaml");
```

If you want to inject dependencies to set the route template, use:
Expand All @@ -62,7 +62,7 @@ builder.Services.AddOptions<SwaggerOptions>().Configure<IServiceProvider>((optio
{
var webHostEnvironment = serviceProvider.GetRequiredService<IWebHostEnvironment>();
string appName = webHostEnvironment.ApplicationName;
options.RouteTemplate = $"api-docs/{{documentName}}/{appName}-swagger.yaml";
options.RouteTemplate = $"/api-docs/{{documentName}}/{appName}-swagger.yaml";
});
```

Expand Down
2 changes: 1 addition & 1 deletion package-versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<CodeAnalysisFrozenVersion>4.1.0</CodeAnalysisFrozenVersion>
<DemystifierFrozenVersion>0.4.1</DemystifierFrozenVersion>
<HumanizerFrozenVersion>2.14.1</HumanizerFrozenVersion>
<SwashbuckleFrozenVersion>6.5.0</SwashbuckleFrozenVersion>
<SwashbuckleFrozenVersion>6.6.1</SwashbuckleFrozenVersion>
<NewtonsoftJsonFrozenVersion>13.0.3</NewtonsoftJsonFrozenVersion>

<!-- Non-published dependencies (these are safe to update, won't cause a breaking change) -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public OpenApiDescriptionLinkProvider(IOptionsMonitor<SwaggerGeneratorOptions> s
string latestVersionDocumentName = swaggerGeneratorOptions.SwaggerDocs.Last().Key;

SwaggerOptions swaggerOptions = _swaggerOptionsMonitor.CurrentValue;
return swaggerOptions.RouteTemplate.Replace("{documentName}", latestVersionDocumentName).Replace("{json|yaml}", "json");
return swaggerOptions.RouteTemplate.Replace("{documentName}", latestVersionDocumentName).Replace("{extension:regex(^(json|ya?ml)$)}", "json");
}

return null;
Expand Down
Loading
Loading