Replies: 1 comment 2 replies
|
Indeed, you are no longer meant to use One of the key pain points I brought up with the ASP.NET team is the XML Comments support. It was been hacked together and is deeply coupled with The unfortunate consequence is that I've had to fork all of the XML Comment support 😞. Some of the implementation is simple and straight forward, while others are quite complex and have transformations. I tried, and thought I had, covered the core set of things people really care about. I don't have the full background history or knowledge of how or what is actually supported. Some if it didn't really make sense to me; for example, why would you have a There is a work in progress that will go in the next and official release for FWIW, if you're using API Versioning with OpenAPI support, you don't need a custom The |
Uh oh!
There was an error while loading. Please reload this page.
While upgrading to version 10.0.0 of this library, I tried to follow the new and revised best practices and examples from Chris Martinez and Microsoft. Everything works fine but when I checked if all my doc comments were shown in Swagger UI, I noticed that the
<remarks>and<returns>sections were missing. After a bit of troubleshooting I found out that the sections in question are only correctly included in the OpenAPI document whenbuilder.Services.AddOpenApi()is called in addition to the overload on theIApiVersioningBuildersince theMicrosoft.AspNetCore.OpenApiinterceptor only intercepts the libraries own methods. I also found that the handlers have to be public for this to work. Thank you for clarifying in #1200 that AOT support (enabled through #66408) is not expected until .NET 11.My question now is, what is the "correct" way to configure both
Microsoft.AspNetCore.OpenApiandAsp.Versioningsuch that all doc comments are supported and no redundant configuration is performed? Is an additional call tobuilder.Services.AddOpenApi()considered misconfiguration and is the order of the calls relevant here?Bonus question: Why are currently all doc comments except
<remarks>and<returns>correctly added to the OpenAPI document? Were they overlooked in the current implementation?I followed these setup guides:
Minimal reproduction example (tested on SDK 10.0.201):
builder.Services.AddOpenApi()—<remarks>and<returns>now appear in http://localhost:5000/swaggerAll reactions