Repository navigation
Open
Feature
1 / 51 of 5 issues completed
Copy link
Labels
area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi
Milestone
Description
This is a meta-issue to track a set of improvements that can be made to the tooling we currently provide for generating OpenAPI documents at build-time.
Build-time OpenAPI document generation issue currently supported by the Microsoft.Extensions.ApiDescription.Server package and was primarily implemented with the assumption that another package (like Swashbuckle or NSwag) would be installed alongside it.
Here's a braindump of the current issues with the design and how we might improve them in the future:
- The current implementation uses an internal executable that is called via MSBuild, so there's massaging that needs to be done when mapping the MSBuild arguments to arguments for the CLI tool. IMO, we should ship either a tool or stick to MSBuild targets. I don't think there's much value in providing half-baked support for both.
- The current implementation is intended to work with tools like Swashbuckle, which support a wider set of target frameworks that we intend to. Moving to a different approach would allow us to remove code/packaging logic related to unsupported frameworks (netfx, netstandard).
- I'd like to standardize the configuration story for build-time document generation so there's an official schema exposed via options (similar to what you get with Aspire's config model) to improve the discoverability of these options.
- The current implementation relies on private reflection-based contract exposed via the “IDocumentProvider” interface. This interface should be fleshed out and made public.
- The current implementation will attempt to boot up the application's entry-point at build-time in oder to resolve the
IDocumentProviderinstance from the DI container. This can present issues for applications that resolve configuration at startup that might not exist when it is launched by the command line tool. Furthermore, it's difficult to detect when an application is being launched by the tool which makes it difficult to create conditional logic for this behavior.
This collection of issues and our overall investment in OpenAPI warrants another look here to see if we can establish something better and address something of these pain-points. The goals of this effort include:
- Reducing the reliance on internal or undocumented APIs for the implementation
- Streamline the process for configuring options for the command line tool
- Make it easier to stub out unavailable startup dependences in the entry points
Reacted by Martin Costello, boukenka, Matt Parker, Ben Longo, Greg Bachraty, Bruno B. de Souza, Chris/0, Rogier van der Hee, Jesse Xia, Safia Abdalla and 13 more
Reacted by Justin Lampe, Bruno B. de Souza, Ali Aslan, MarianSWA, Hans Pagel and Ákos Lukács
Sub-issues
Collapse Sub-issuesSub-issues
Loading 5 sub-issues
Metadata
Metadata
Assignees
Labels
area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi
Activity
marinasundstrom commentedon Nov 12, 2024
captainsafia commentedon Nov 14, 2024
@marinasundstrom I think you might've intended to post this comment on the issue tracking adoption of 3.1 support: #58619
mikekistler commentedon Jun 25, 2025
Sadly we have to drop this off the roadmap for .NET 10 due to resource constraints.
gareth-a-jones commentedon Nov 19, 2025
We are very interested in driving along this path for the M365 Substrate. We have hundreds of APIs on a wide variety of stacks from Fx462 through many recent versions of dotnet. Clearly, we are working to migrate them to latest dotnet, but it is slow (years slow etc.)
Most of these APIs are JSON REST-ish based on ASP.net - some with OData of various point versions.
Being able to create openAPI documents for services without having to check a line of code into that services repo is our key ask.
Getting permissions to make even minor changes at scale across substrate will turn this project into a year or more's investment and likely kill or severely limit it.
Consequently we need a wholly external scanner that can load the target system's assemblies into some hosting tool and spit out reasonably accurate openAI files.