We have a Web API with ~150 controllers (~500 methods) which we upgraded from Core2.2 to net5.0 and along with it we upgraded the Swashbuckle package.
The old version of Swashbuckle used SwaggerResponse attribute to display information on SwaggerUI and we used it heavily over our ~500 methods.
At some point the SwaggerResponse attribute was deprecated and the recommended solution is a different approach:
https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/159
Is there a way to
- either use the
SwaggerResponseattribute in latest Swashbuckle, or - convert the existing code?
It's recommended that you use
ProduceResponseTypeAttribute, However you can still useSwaggerResponsevia the NuGet package Swashbuckle.AspNetCore.Annotations.The type
SwaggerResponsewasn't completely removed it was just moved away from the main Swashbuckle package namely Swashbuckle.AspNetCore to an optional extra package Swashbuckle.AspNetCore.Annotations