Support XML-based OpenAPI docs for minimal APIs
See original GitHub issueIs there an existing issue for this?
- I have searched the existing issues
Describe the bug
Swashbuckle currently supports reading the XML doc string associated with an action’s method to derive the description, summary, example, etc for an action.
We need to add similar support for minimal endpoints where the documentation might be on a referenced method group or (maybe) on a Map*
invocation.
Expected Behavior
/// <summary>
/// This is a foo.
/// </summary>
string GetFoo() => "This is a test";
Should resolve the correct summary info.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:39
- Comments:13 (5 by maintainers)
Top Results From Across the Web
How to use OpenAPI in Minimal API apps
Minimal APIs provide built-in support for generating information about endpoints in an app via the Microsoft.AspNetCore.OpenApi package.
Read more >Using XML Documentation With ASP.NET Core Minimal ...
In this short post, we'll go through the steps required to add more detailed information to your OpenAPI Schema files, resulting in more...
Read more >Quickly create a .Net 6 minimal API with swagger ...
The minimal API will help developers to build microservices with very ... Swagger (OpenAPI Specification): Empowering the API Documentation ...
Read more >Open API support for ASP.NET Core Minimal API
This article will discuss about implementing Open API (Swagger) for ASP.NET Core 6.0 minimal API. Today I saw one video from Maria Naggaga ......
Read more >Apache CXF -- Index
Apache CXF™ is an open source services framework. CXF helps you build and develop services using frontend programming APIs, like JAX-WS and JAX-RS....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I consider this functionality unnecessary. Given the way REST APIs are created and the constant proliferation of approaches like microservices and API gateways, generating documentation in general makes no sense. The documentation generated falls short of the quality of the specification and reflects implementation errors. Generated documentation is unusable in practice for automation, mocking and testing. The specification first approach has been a trend for several years.
Just FYI, this already works, as long as you
IncludeXmlComments
inAddSwaggerGen()
That last point is the biggest sticking point - it would be great if you could use lambdas too, but at least this partially works 🙂
One observation (I’m not sure if it’s a bug or expected behaviour). If you use
WithOpenApi()
, it wipes out any existing documentation of the parameters that comes from XML