Skip to content

Migrate OpenAPI docs from Swashbuckle to Scalar#49

Merged
xavierjohn merged 5 commits intomainfrom
xavier/scalar
Mar 14, 2026
Merged

Migrate OpenAPI docs from Swashbuckle to Scalar#49
xavierjohn merged 5 commits intomainfrom
xavier/scalar

Conversation

@xavierjohn
Copy link
Owner

Replaced Swashbuckle.AspNetCore with Scalar.AspNetCore and Microsoft.AspNetCore.OpenApi across all sample projects. Updated service configuration to use AddOpenApi and Scalar endpoints. Removed custom Swashbuckle filters and configuration classes. Updated launch URLs to use Scalar's UI. Cleaned up copilot instructions and added notes for future OpenAPI improvements.

Replaced Swashbuckle.AspNetCore with Scalar.AspNetCore and Microsoft.AspNetCore.OpenApi across all sample projects. Updated service configuration to use AddOpenApi and Scalar endpoints. Removed custom Swashbuckle filters and configuration classes. Updated launch URLs to use Scalar's UI. Cleaned up copilot instructions and added notes for future OpenAPI improvements.
# Conflicts:
#	.github/copilot-instructions.md
…and Asp.Versioning.Mvc.ApiExplorer to 10.0.0-preview.2
…r ServiceLevelIndicator with Configure method and improve section headings for clarity
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the sample projects’ OpenAPI tooling from Swashbuckle to the built-in Microsoft.AspNetCore.OpenApi pipeline and Scalar UI, while updating docs to reflect current DI/registration patterns for the core ServiceLevelIndicators package.

Changes:

  • Replaced Swashbuckle setup (AddSwaggerGen, UseSwagger, UseSwaggerUI, custom filters) with AddOpenApi(), MapOpenApi(), and MapScalarApiReference() in sample apps.
  • Updated sample launch profiles to open Scalar UI (scalar/v1) by default.
  • Updated documentation snippets to use Configure<ServiceLevelIndicatorOptions> + AddSingleton<ServiceLevelIndicator> for the core package.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
sample/WebApiVersioned/SampleVersionedWebApplicationSLI.csproj Swap Swashbuckle dependency for OpenApi + Scalar packages.
sample/WebApiVersioned/Properties/launchSettings.json Default launch URL now points at Scalar UI.
sample/WebApiVersioned/Program.cs Replace Swagger middleware/UI with MapOpenApi + Scalar mapping.
sample/WebApiVersioned/ConfigureSwaggerDefaultOptions.cs Remove Swashbuckle-specific versioned Swagger doc configuration.
sample/WebApiVersioned/AddApiVersionMetadata.cs Remove Swashbuckle operation filter workaround.
sample/WebApi/SampleWebApplicationSLI.csproj Swap Swashbuckle dependency for OpenApi + Scalar packages.
sample/WebApi/Properties/launchSettings.json Default launch URL now points at Scalar UI.
sample/WebApi/Program.cs Replace Swagger middleware/UI with MapOpenApi + Scalar mapping.
sample/MinApi/SampleMinimalApiSli.csproj Swap Swashbuckle dependency for OpenApi + Scalar packages.
sample/MinApi/Properties/launchSettings.json Default launch URL now points at Scalar UI.
sample/MinApi/Program.cs Replace Swagger middleware/UI with MapOpenApi + Scalar mapping.
docs/usage-reference.md Update core package registration guidance (options + singleton registration).
ServiceLevelIndicators/src/README.md Update core package quick start to match current DI registration pattern.
README.md Adjust headings/structure and update an ASP.NET Core snippet for AutomaticallyEmitted.
Directory.Packages.props Centralize Scalar package version and remove Swashbuckle version.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@xavierjohn xavierjohn merged commit b7b9287 into main Mar 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants