Skip to content

refactor: replace Swashbuckle with Microsoft.AspNetCore.OpenApi#648

Merged
berezovskyi merged 2 commits intomainfrom
b-openapi
Mar 14, 2026
Merged

refactor: replace Swashbuckle with Microsoft.AspNetCore.OpenApi#648
berezovskyi merged 2 commits intomainfrom
b-openapi

Conversation

@berezovskyi
Copy link
Member

@berezovskyi berezovskyi commented Mar 14, 2026

Summary by CodeRabbit

  • Chores
    • Upgraded API documentation infrastructure from Swagger/Swashbuckle to OpenAPI.
    • API documentation endpoint updated to openapi/v1.json across launch configurations.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 70ac52f0-abe3-4147-a0bd-6ca63269d137

📥 Commits

Reviewing files that changed from the base of the PR and between 0cb6e19 and b7bde60.

📒 Files selected for processing (1)
  • OSLC4Net_SDK/Examples/OSLC4NetExamples.Server.NetCoreApi/Properties/launchSettings.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • OSLC4Net_SDK/Examples/OSLC4NetExamples.Server.NetCoreApi/Properties/launchSettings.json

Walkthrough

Migrates OpenAPI tooling from Swashbuckle.AspNetCore to Microsoft.AspNetCore.OpenApi: updates package references, replaces Swagger/Swashbuckle service and pipeline calls with AddOpenApi()/MapOpenApi(), and adjusts launch settings to point at openapi/v1.json.

Changes

Cohort / File(s) Summary
Package Dependency Updates
OSLC4Net_SDK/Directory.Packages.props, OSLC4Net_SDK/Examples/OSLC4NetExamples.Server.NetCoreApi/OSLC4NetExamples.Server.NetCoreApi.csproj
Replaced Swashbuckle.AspNetCore v6.6.2 with Microsoft.AspNetCore.OpenApi v10.0.0 in centralized package props and project reference.
OpenAPI Integration
OSLC4Net_SDK/Examples/OSLC4NetExamples.Server.NetCoreApi/Program.cs
Removed AddEndpointsApiExplorer() and AddSwaggerGen(); added AddOpenApi() and replaced development pipeline UseSwagger()/UseSwaggerUI() with MapOpenApi().
Launch Configuration
OSLC4Net_SDK/Examples/OSLC4NetExamples.Server.NetCoreApi/Properties/launchSettings.json
Updated launch URLs to use openapi/v1.json instead of swagger routes across profiles (HTTPS, IIS Express, Docker).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through code with nimble feet,
Swapped feathers of Swagger for OpenAPI sweet,
New routes, new packages, a tidy trail,
I nibble bugs and leave a clean tail. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'refactor: replace Swashbuckle with Microsoft.AspNetCore.OpenApi' accurately and concisely describes the main change: replacing the Swashbuckle.AspNetCore package with Microsoft.AspNetCore.OpenApi across multiple files in the project.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch b-openapi
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@berezovskyi berezovskyi enabled auto-merge March 14, 2026 15:57
@berezovskyi berezovskyi added this pull request to the merge queue Mar 14, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
OSLC4Net_SDK/Examples/OSLC4NetExamples.Server.NetCoreApi/Properties/launchSettings.json (1)

6-24: ⚠️ Potential issue | 🟡 Minor

Update Docker launch URL to OpenAPI endpoint as well.

Line 24 still targets /swagger, so the Docker profile will launch to a stale path after this migration.

Proposed fix
-      "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger",
+      "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/openapi/v1.json",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@OSLC4Net_SDK/Examples/OSLC4NetExamples.Server.NetCoreApi/Properties/launchSettings.json`
around lines 6 - 24, Update the Docker launch profile so its launchUrl points to
the OpenAPI endpoint like the other profiles: locate the "Container
(Dockerfile)" profile in launchSettings.json and change its "launchUrl" value
from "{Scheme}://{ServiceHost}:{ServicePort}/swagger" to the OpenAPI path used
elsewhere (e.g. "{Scheme}://{ServiceHost}:{ServicePort}/openapi/v1.json") so
Docker launches the correct OpenAPI endpoint.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In
`@OSLC4Net_SDK/Examples/OSLC4NetExamples.Server.NetCoreApi/Properties/launchSettings.json`:
- Around line 6-24: Update the Docker launch profile so its launchUrl points to
the OpenAPI endpoint like the other profiles: locate the "Container
(Dockerfile)" profile in launchSettings.json and change its "launchUrl" value
from "{Scheme}://{ServiceHost}:{ServicePort}/swagger" to the OpenAPI path used
elsewhere (e.g. "{Scheme}://{ServiceHost}:{ServicePort}/openapi/v1.json") so
Docker launches the correct OpenAPI endpoint.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7ae49c57-5827-4978-83b3-57b3f5d33459

📥 Commits

Reviewing files that changed from the base of the PR and between 2eb12d5 and 0cb6e19.

📒 Files selected for processing (4)
  • OSLC4Net_SDK/Directory.Packages.props
  • OSLC4Net_SDK/Examples/OSLC4NetExamples.Server.NetCoreApi/OSLC4NetExamples.Server.NetCoreApi.csproj
  • OSLC4Net_SDK/Examples/OSLC4NetExamples.Server.NetCoreApi/Program.cs
  • OSLC4Net_SDK/Examples/OSLC4NetExamples.Server.NetCoreApi/Properties/launchSettings.json

@berezovskyi berezovskyi removed this pull request from the merge queue due to a manual request Mar 14, 2026
@berezovskyi berezovskyi enabled auto-merge March 14, 2026 16:01
@berezovskyi berezovskyi added this pull request to the merge queue Mar 14, 2026
Merged via the queue into main with commit 4893fb9 Mar 14, 2026
9 checks passed
@berezovskyi berezovskyi deleted the b-openapi branch March 14, 2026 16:08
@codecov
Copy link

codecov bot commented Mar 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.87%. Comparing base (64da307) to head (b7bde60).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #648      +/-   ##
==========================================
+ Coverage   50.86%   51.87%   +1.01%     
==========================================
  Files         174      174              
  Lines       10202    10248      +46     
  Branches     1010     1020      +10     
==========================================
+ Hits         5189     5316     +127     
+ Misses       4756     4677      -79     
+ Partials      257      255       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant