Skip to content

Swap Swagger UI to more professional Scalar UI docs#236

Merged
kamilbaczek merged 9 commits intomainfrom
copilot/integrate-chapter-1-with-scalar
Mar 29, 2026
Merged

Swap Swagger UI to more professional Scalar UI docs#236
kamilbaczek merged 9 commits intomainfrom
copilot/integrate-chapter-1-with-scalar

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 24, 2026

📋 Description

Replaces Swagger UI with Scalar for professional API documentation in Chapter 1. Scalar provides a modern API reference UI with interactive testing capabilities, multi-language code snippets, and full OpenAPI 3.1 support.

Changes

  • Added Scalar.AspNetCore (v2.12.17)
  • Removed Swashbuckle.AspNetCore (redundant with native OpenAPI)
  • Updated Program.cs:
    builder.Services.AddOpenApi();
    // ...
    app.MapOpenApi();
    app.MapScalarApiReference("/docs/{documentName}");
  • Updated root redirect: /swagger/docs/v1
  • Updated launchSettings.json to open Scalar docs (/docs/v1) on app start
  • Fixed IDE0370 build errors: removed unnecessary null-forgiving operators in architecture and integration tests

📦 PR Includes

  • Feature added 🆕
  • Bug fix 🐛
  • Code refactor 🔄
  • Documentation update 📚
  • Tests added/updated 🧪
  • Other: (describe)

🚫 PR Does Not Include

  • Breaking changes ❌
  • Major architectural changes 🏗️
  • Unrelated features/tasks 🚫

💡 Additional Notes

API documentation now available at /docs/v1 in development mode. Uses native Microsoft.AspNetCore.OpenApi for spec generation. The app will automatically open the Scalar documentation when launched.

Build fixes included: removed unnecessary null-forgiving operators (!) from test files to resolve IDE0370 analyzer errors.

Original prompt

Create app.UseSwaggerUI();
https://scalar.com/products/api-references/integrations/aspnetcore/integration

integrate chapter 1 with scalar. Ensure that in documetation it is updaed and we are using open API. If you can add to description screnshot after and before


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@kamilbaczek
Copy link
Copy Markdown
Collaborator

@copilot use /docs

@kamilbaczek
Copy link
Copy Markdown
Collaborator

@copilot remover screens from repo and .adoc file mention before after. Instead of saying we are leveraging swagger. Describe shortly in docs that we are using professional API documentation thanks to scalar and this to lib list which is also in .adc

@kamilbaczek
Copy link
Copy Markdown
Collaborator

@copilot change mr tilte to Swap Swagger UI to more professional Scalar UI docs

Copilot AI changed the title [WIP] Add Swagger UI integration and OpenAPI documentation Integrate Scalar API Reference in Chapter 1, replacing Swagger UI Jan 24, 2026
Copilot AI requested a review from kamilbaczek January 24, 2026 08:45
@kamilbaczek
Copy link
Copy Markdown
Collaborator

@copilot change base path to documentation /docs/v1 instead /scalar/v1

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 24, 2026

@copilot remover screens from repo and .adoc file mention before after. Instead of saying we are leveraging swagger. Describe shortly in docs that we are using professional API documentation thanks to...

Done in 9b82665. Removed screenshots from repo and simplified the API Documentation section to briefly describe Scalar as professional API documentation with interactive testing and OpenAPI 3.1 support.

@copilot change mr tilte to Swap Swagger UI to more professional Scalar UI docs

I cannot change the PR title directly. Please update it to: "Swap Swagger UI to more professional Scalar UI docs"

Copilot AI changed the title Integrate Scalar API Reference in Chapter 1, replacing Swagger UI Swap Swagger UI to more professional Scalar UI docs Jan 24, 2026
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 24, 2026

@copilot change base path to documentation /docs/v1 instead /scalar/v1

Done in 240b052. Changed the base path from /scalar/v1 to /docs/v1 in Program.cs, the redirect extension, and README.adoc.

@kamilbaczek
Copy link
Copy Markdown
Collaborator

@copilot ==== API Documentation

For professional API documentation, we use https://scalar.com[Scalar] - a modern API reference UI that provides interactive testing capabilities, multi-language code snippets, and full OpenAPI 3.1 support. The documentation is available at /docs/v1 in development mode.

remove

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 25, 2026

@copilot ==== API Documentation

For professional API documentation, we use https://scalar.com[Scalar] - a modern API reference UI that provides interactive testing capabilities, multi-language code...

Done in e272b44. Removed the API Documentation section from README.adoc.

@kamilbaczek
Copy link
Copy Markdown
Collaborator

@copilot adjust lunch settings to app start with scalar

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 18, 2026

@copilot adjust lunch settings to app start with scalar

Done in 25376b0. Updated launchSettings.json to change launchUrl from swagger to docs/v1 in all profiles (http, https, and IIS Express). The app will now open the Scalar documentation on start.

@kamilbaczek kamilbaczek marked this pull request as ready for review March 22, 2026 12:01
@kamilbaczek
Copy link
Copy Markdown
Collaborator

image final effect

@kamilbaczek kamilbaczek enabled auto-merge (squash) March 29, 2026 17:42
Co-authored-by: kamilbaczek <74410956+kamilbaczek@users.noreply.github.com>
Copilot AI and others added 6 commits March 29, 2026 19:42
Co-authored-by: kamilbaczek <74410956+kamilbaczek@users.noreply.github.com>
Co-authored-by: kamilbaczek <74410956+kamilbaczek@users.noreply.github.com>
Co-authored-by: kamilbaczek <74410956+kamilbaczek@users.noreply.github.com>
Co-authored-by: kamilbaczek <74410956+kamilbaczek@users.noreply.github.com>
@kamilbaczek kamilbaczek force-pushed the copilot/integrate-chapter-1-with-scalar branch from 8ab9716 to 417b874 Compare March 29, 2026 17:42
@kamilbaczek
Copy link
Copy Markdown
Collaborator

@copilot fix
architecture/Src/Fitnet.AppHost/bin/Debug/net10.0/EvolutionaryArchitecture.Fitnet.AppHost.dll
Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.ArchitectureTests/BussinessRulesArchitectureTests.cs(21,46): error IDE0370: Suppression is unnecessary (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0370) [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.ArchitectureTests/Fitnet.ArchitectureTests.csproj]
Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.ArchitectureTests/ContractsArchitectureTests.cs(27,37): error IDE0370: Suppression is unnecessary (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0370) [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.ArchitectureTests/Fitnet.ArchitectureTests.csproj]
Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.ArchitectureTests/ReportsArchitectureTests.cs(27,37): error IDE0370: Suppression is unnecessary (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0370) [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.ArchitectureTests/Fitnet.ArchitectureTests.csproj]
Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.ArchitectureTests/PassesArchitectureTests.cs(28,37): error IDE0370: Suppression is unnecessary (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0370) [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.ArchitectureTests/Fitnet.ArchitectureTests.csproj]
Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.ArchitectureTests/PassesArchitectureTests.cs(53,37): error IDE0370: Suppression is unnecessary (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0370) [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.ArchitectureTests/Fitnet.ArchitectureTests.csproj]
Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.ArchitectureTests/OffersArchitectureTests.cs(28,37): error IDE0370: Suppression is unnecessary (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0370) [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.ArchitectureTests/Fitnet.ArchitectureTests.csproj]
Fitnet.UnitTests -> /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.UnitTests/bin/Debug/net10.0/EvolutionaryArchitecture.Fitnet.UnitTests.dll
Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.IntegrationTests/Common/Events/EventBus/InMemory/InMemoryEventBusTests.cs(22,23): error IDE0370: Suppression is unnecessary (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0370) [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.IntegrationTests/Fitnet.IntegrationTests.csproj]
Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.IntegrationTests/Common/Events/EventBus/InMemory/InMemoryEventBusTests.cs(30,27): error IDE0370: Suppression is unnecessary (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0370) [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.IntegrationTests/Fitnet.IntegrationTests.csproj]

Build FAILED.

Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.ArchitectureTests/BussinessRulesArchitectureTests.cs(21,46): error IDE0370: Suppression is unnecessary (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0370) [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.ArchitectureTests/Fitnet.ArchitectureTests.csproj]
Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.ArchitectureTests/ContractsArchitectureTests.cs(27,37): error IDE0370: Suppression is unnecessary (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0370) [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.ArchitectureTests/Fitnet.ArchitectureTests.csproj]
Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.ArchitectureTests/ReportsArchitectureTests.cs(27,37): error IDE0370: Suppression is unnecessary (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0370) [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.ArchitectureTests/Fitnet.ArchitectureTests.csproj]
Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.ArchitectureTests/PassesArchitectureTests.cs(28,37): error IDE0370: Suppression is unnecessary (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0370) [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.ArchitectureTests/Fitnet.ArchitectureTests.csproj]
Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.ArchitectureTests/PassesArchitectureTests.cs(53,37): error IDE0370: Suppression is unnecessary (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0370) [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.ArchitectureTests/Fitnet.ArchitectureTests.csproj]
Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.ArchitectureTests/OffersArchitectureTests.cs(28,37): error IDE0370: Suppression is unnecessary (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0370) [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.ArchitectureTests/Fitnet.ArchitectureTests.csproj]
Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.IntegrationTests/Common/Events/EventBus/InMemory/InMemoryEventBusTests.cs(22,23): error IDE0370: Suppression is unnecessary (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0370) [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.IntegrationTests/Fitnet.IntegrationTests.csproj]
Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.IntegrationTests/Common/Events/EventBus/InMemory/InMemoryEventBusTests.cs(30,27): error IDE0370: Suppression is unnecessary (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0370) [/home/runner/work/evolutionary-architecture-by-example/evolutionary-architecture-by-example/Chapter-1-initial-architecture/Src/Fitnet.IntegrationTests/Fitnet.IntegrationTests.csproj]

auto-merge was automatically disabled March 29, 2026 19:23

Head branch was pushed to by a user without write access

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 29, 2026

@copilot fix
architecture/Src/Fitnet.AppHost/bin/Debug/net10.0/EvolutionaryArchitecture.Fitnet.AppHost.dll
Error: /home/runner/work/evolutionary-architecture-by-example/evolutionary-...

Fixed in fa4eab9. Removed unnecessary null-forgiving operators (!) from 6 files:

  • BussinessRulesArchitectureTests.cs
  • ContractsArchitectureTests.cs
  • ReportsArchitectureTests.cs
  • PassesArchitectureTests.cs
  • OffersArchitectureTests.cs
  • InMemoryEventBusTests.cs

Build now succeeds with 0 errors.

Copilot AI requested a review from kamilbaczek March 29, 2026 19:24
@kamilbaczek kamilbaczek merged commit 74511cf into main Mar 29, 2026
2 checks passed
@kamilbaczek kamilbaczek deleted the copilot/integrate-chapter-1-with-scalar branch March 29, 2026 19:25
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