Migrate OpenAPI docs from Swashbuckle to Scalar#49
Merged
xavierjohn merged 5 commits intomainfrom Mar 14, 2026
Merged
Conversation
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
There was a problem hiding this comment.
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) withAddOpenApi(),MapOpenApi(), andMapScalarApiReference()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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.