I want to change controller description of NSwag UI in .Net Core. I am using latest version (13.8.1). How to achieve this?
From the image above, I want to rename the title RefUserLocation
to User Location
. But doesn't change the endpoint itself where users are still able to access to api/refuserlocation
Add [OpenApiTag("RenameName")]
to your controller like below:
using NSwag.Annotations;
[Route("api/[controller]")]
[ApiController]
[OpenApiTag("User Location")]
public class RefUserLocationController : ControllerBase
{...}
Note:
I use NSwag.AspNetCore version 13.8.2
.So the SwaggerTag
is obsolete,if you used the older version of nswag,you could use [SwaggerTag("User Location")]
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.