New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do you specify controller descriptions? #1803
Comments
You should integrate with the middleware and use the api explorer based generator for asp.net core |
You need to enable xml docs output in the project... |
@RSuter , I do have xml doc output enabled in the project. Without it, I wasn't getting any summary/parameter documentation at all. It is enabled and it is working for controller actions. But what I'm lacking are descriptions on the actual controllers themselves. For clarification of what I'm looking for, the demo at http://petstore.swagger.io includes descriptions on each of the 3 controllers, as well as additional information displayed on the right. |
|
The controller descriptions cannot be preserved because "controllers" is not a concept of Swagger and only internally generated/grouped by NSwag... We'd need to enhance the spec with custom data with controller info etc. |
Guessing this feature isn't being added anytime soon? |
Probably not, as custom extensions do not bring much value as they are not understood by consumers (external client gens, etc.) But you can do this manually with custom operation processors: https://github.com/RicoSuter/NSwag/wiki/Document-Processors-and-Operation-Processors |
Could not controllers be mapped to the tags concept in swagger.
|
I think this is already the case except that the description is not used, can you create a PR? |
I tested it these times, and it is still not working with the |
now,u can use that enable controller description: services.AddSwaggerDocument(c =>
{
c.UseControllerSummaryAsTagDescription = true;
}); |
I have a .NET Core web API written in C# and I have been unable to get NSwag to include descriptions for the controllers. I have tried a DescriptionAttribute and a standard
<summary>
comment. My actions and parameters are being properly documented, including description (summary) and remarks.Also, I see from the documentation that there's a recommendation to set
IsAspNetCore
to true. Where/how do you set that value and is it a current requirement? I'm not sure what the implications are of the "reflection based generator eventually being deprecated" - does that mean that I need to change my approach to controller documentation somehow?The text was updated successfully, but these errors were encountered: