I have controller like
public class UserController : ApiController
{
[Route("api/user")]
IHttpActionResult GetUser() { ... }
}
public class ResumeController : ApiController
{
[Route("api/user/resumes")]
IHttpActionResult GetResumes() { ... }
}
Which on swagger generates output like
Is there a way (besides overriding default implementation by rolling out your own ISwaggerProvider
or merging two controllers into one) to enforce the group name ? Something like
public class UserController : ApiController
{
[Route("api/user")]
[MagicalAttributeName(Group="User")]
IHttpActionResult GetUser() { ... }
}
public class ResumeController : ApiController
{
[Route("api/user/resumes")]
[MagicalAttributeName(Group="User")]
IHttpActionResult GetResumes() { ... }
}
You could also use SwaggerOperationAttribute:
public class UserController : ApiController
{
[Route("api/user")]
[SwaggerOperation(Tags = new[] { "User" })]
IHttpActionResult GetUser() { ... }
}
public class ResumeController : ApiController
{
[Route("api/user/resumes")]
[SwaggerOperation(Tags = new[] { "User" })]
IHttpActionResult GetResumes() { ... }
}