Skip to content

Enable open api in all environment across all projects (#12475)#12486

Merged
yasmoradi merged 1 commit into
bitfoundation:developfrom
yasmoradi:12475
Jun 18, 2026
Merged

Enable open api in all environment across all projects (#12475)#12486
yasmoradi merged 1 commit into
bitfoundation:developfrom
yasmoradi:12475

Conversation

@yasmoradi

@yasmoradi yasmoradi commented Jun 18, 2026

Copy link
Copy Markdown
Member

closes #12475

Summary by CodeRabbit

  • Chores
    • API documentation endpoints are now available across all deployment environments.
    • Applied performance caching to API documentation endpoints in select applications.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: eeeb2474-569d-435b-9164-7ffbefdce7a7

📥 Commits

Reviewing files that changed from the base of the PR and between c788d7d and ea8a172.

📒 Files selected for processing (6)
  • src/BlazorUI/Demo/Bit.BlazorUI.Demo.Server/Startup/Middlewares.cs
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Program.Middlewares.cs
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/Program.Middlewares.cs
  • src/Websites/Careers/src/Bit.Websites.Careers.Server/Startup/Middlewares.cs
  • src/Websites/Platform/src/Bit.Websites.Platform.Server/Startup/Middlewares.cs
  • src/Websites/Sales/src/Bit.Websites.Sales.Server/Startup/Middlewares.cs

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting


Walkthrough

Across six ASP.NET server projects (BlazorUI demo, Boilerplate API and Web templates, and Careers/Platform/Sales websites), the if (env.IsProduction() is false) guard is removed from Swagger/OpenAPI/Scalar middleware registration so API documentation endpoints are always mapped regardless of environment.

Changes

OpenAPI/Swagger unconditional registration across all server projects

Layer / File(s) Summary
Remove production guard from API docs registration
src/BlazorUI/Demo/Bit.BlazorUI.Demo.Server/Startup/Middlewares.cs, src/Templates/Boilerplate/.../Boilerplate.Server.Api/Program.Middlewares.cs, src/Templates/Boilerplate/.../Boilerplate.Server.Web/Program.Middlewares.cs, src/Websites/Careers/.../Startup/Middlewares.cs, src/Websites/Platform/.../Startup/Middlewares.cs, src/Websites/Sales/.../Startup/Middlewares.cs
UseSwagger/UseSwaggerUI (classic projects) and MapOpenApi/MapScalarApiReference with /swagger redirect (Boilerplate templates) are moved outside the if (env.IsProduction() is false) block, making them unconditional in all environments.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 Hop, hop, the docs are free!
No more hiding from production, you see,
Swagger blooms on every deploy,
Scalar shines — what a joy!
The rabbit says: API for all, come along with me! 🌸

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@yasmoradi yasmoradi merged commit 5aefed7 into bitfoundation:develop Jun 18, 2026
3 of 5 checks passed
@yasmoradi yasmoradi deleted the 12475 branch June 18, 2026 21:10
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.

Open API endpoints must be enabled across all environments

1 participant