Open fleed opened 7 years ago
So the idea is to ignore empty descriptions for the "or"ed description?
@RSuter actually I would prefer to show only the content of the SwaggerResponse.Description
attribute.
The <returns></returns>
value should be used for status code 200 only as fallback if the SwaggerResponse(200)
attribute is not specified.
I dont see the problem (see commit)
Having both ProducesResponseType and SwaggerResponse in your code looks like an unfinished refactoring. I am not sure that NSwag should work around a bad implementation.
Currently, ProducesResponesTypeAttribute and SwaggerResponseAttribute are treated as if they were the same. Maybe we should process ProducesResponesTypeAttribute only if no SwaggerResponseAttributes are defined?
Respecting this rule: https://github.com/RSuter/NSwag/pull/994#discussion_r144952082
Specifying both
ProducesResponseType
andSwaggerResponse
attributes creates a documentation with an or between theSwaggerResponse.Description
property and the value of thereturns
documentation of the method (response 200).For all other responses, the output is an or between the
SwaggerResponse.Description
and empty string (the .NET attribute doesn't support a description https://docs.microsoft.com/en-us/aspnet/core/api/microsoft.aspnetcore.mvc.producesresponsetypeattribute#Properties)