Open Zero3 opened 5 years ago
Can you create a PR to assign the correct property (Description) and remove the if/else so that the summary is set to the xml docs?
@RSuter The change would conflict with this piece of code below, which I don't know what to do about:
var remarks = await context.MethodInfo.GetXmlRemarksAsync().ConfigureAwait(false);
if (remarks != string.Empty)
context.OperationDescription.Operation.Description = remarks;
I think it is better if someone with better knowledge of the various OpenAPI / XML fields fixes this.
The content of a
DescriptionAttribute
on a controller method (operation) is parsed into a OpenAPIsummary
field instead of adescription
field. This seems to be a bug, and leads to incorrect displaying in frontends like ReDoc.The issue is located in this piece of code:
(https://github.com/RSuter/NSwag/blob/master/src/NSwag.SwaggerGeneration/Processors/OperationSummaryAndDescriptionProcessor.cs)
As seen, the
Operation.Summary
field is set instead ofOperation.Description
as expected.The documentation seems correct, as it says:
(https://github.com/RSuter/NSwag/wiki/WebApiToSwaggerGenerator#supported-aspnet-web-api-attributes)
I noticed that this issue was previously mentioned in a comment on another issue, but likely since forgotten: https://github.com/RSuter/NSwag/issues/292#issuecomment-246939878