Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Disable build-time document generation#2684

Open
dmytro-pryvedeniuk wants to merge 3 commits intoJasperFx:mainfrom
dmytro-pryvedeniuk:disable-build-time-document-generation
Open

Disable build-time document generation#2684
dmytro-pryvedeniuk wants to merge 3 commits intoJasperFx:mainfrom
dmytro-pryvedeniuk:disable-build-time-document-generation

Conversation

@dmytro-pryvedeniuk
Copy link
Copy Markdown
Contributor

@dmytro-pryvedeniuk dmytro-pryvedeniuk commented May 6, 2026

This PR disables OpenAPI/Swagger document generation to speed up build time and avoid annoying build failures.

I used native OpenAPI provided by Microsoft.AspNetCore.OpenApi instead of Swashbuckle.AspNetCore in the most of sample projects. It required skipping net8 from TargetFrameworks as AddOpenApi/MapOpenApi methods are available in net9.0+. WolverineWebApi is the only project heavily using Swagger so I just disabled build-time document generation there using OpenApiGenerateDocumentsOnBuild.

In all cases below I used Rebuild from VS2026 with stopped docker containers.

Case 1 - Whole solution (21.20mins vs 38.44mins+9 failed projects)

With my changes:

...
13:52:49:255	========== Rebuild All: 169 succeeded, 0 failed, 3 skipped ==========
13:52:49:255	========== Rebuild completed at 1:52 PM and took 21:20.357 minutes ==========

Without:

...
14:36:38:057	========== Rebuild All: 160 succeeded, 9 failed, 3 skipped ==========
14:36:38:057	========== Rebuild completed at 2:36 PM and took 38:44.193 minutes ==========

Case 2 - Single WebAppWithSQS project (23s vs 2.45mins+failed build)

With my changes:

...
14:48:24:636	========== Rebuild All: 5 succeeded, 0 failed, 0 skipped ==========
14:48:24:636	========== Rebuild completed at 2:48 PM and took 23.208 seconds ==========

Without (document generation emits multiple errors about not available broker).

...
14:43:38:533	========== Rebuild All: 4 succeeded, 1 failed, 0 skipped ==========
14:43:38:533	========== Rebuild completed at 2:43 PM and took 02:45.426 minutes ==========

Case 3 - Single WolverineWebApi project (45s vs 2.30mins)

With my changes:

15:13:48:976	========== Rebuild All: 13 succeeded, 0 failed, 0 skipped ==========
15:13:48:976	========== Rebuild completed at 3:13 PM and took 44.756 seconds ==========

Without (build succeeds here, even without docker containers)

13:09:17:181	========== Rebuild All: 13 succeeded, 0 failed, 1 skipped ==========
13:09:17:181	========== Rebuild completed at 1:09 PM and took 02:30.692 minutes ==========

Switch some sample projects to OpenApi

Skip net8 for some test projects

Skip net8 for some test projects #2

Switch OpenApiDemonstrator and OtelWebApiWolverineMarten to OpenApi

Switch WebApiWithMarten to OpenApi

Switch some projects to OpenApi #3

Switch remaining projects to OpenApi
@dmytro-pryvedeniuk
Copy link
Copy Markdown
Contributor Author

Build logs can be found below.
Case 1 - BEFORE.log
Case 1 - AFTER.log

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