What problem does it solve?
Regenerating the OrchardCore.OpenApi module's NSwag-generated API clients often produces noisy, reshuffled diffs and requires manual server setup, making it hard to tell real API changes from generation noise.
Core Features & Use Cases
- Automated regeneration: Runs the tools/OpenApiClientGenerator console project to boot the CMS in-process, fetch swagger.json, and regenerate both the C# client (Services/OpenApiClient.cs) and TypeScript client (.scripts/bloom/services/OpenApiClient.ts).
- Manual and offline paths: Supports running the nswag CLI against a live dev server or a scratch .nswag config pointing at a local swagger.json for reproducible, offline generation.
- Determinism guidance: Documents the two root causes of unstable output (unsorted Swashbuckle operation order and duplicate operationIds) and how to verify stability by diffing generations from two independent tenants.
- Use Case: After adding a new API endpoint to an OrchardCore module, regenerate the committed OpenApi clients and confirm the diff contains only your new endpoint rather than unrelated reshuffled methods.
Quick Start
Regenerate the OrchardCore OpenApi NSwag clients and verify the resulting diff is stable and contains no reshuffled methods.