dotnet-sdk
dotnet-sdk copied to clipboard
[Topic] Attribute doesn't support dynamic routes
Currently the [Topic] cant be used if the route contains a dynamic part. A example here is a version in the route.
Example dynamic route:
[ApiController]
[ApiVersion("1.0")]
[Route("api/v{v:apiVersion}/example]
public class ExampleController : ControllerBase
{
[HttpPost()]
[Topic("messagebus", "topic")
public async Task<IActionResult> PubSub([FromBody] object message)
{
...
}
}
Example static route:
[ApiController]
[Route("api/v1.0/example]
public class ExampleController : ControllerBase
{
[HttpPost()]
[Topic("messagebus", "topic")
public async Task<IActionResult> PubSub([FromBody] object message)
{
...
}
}
Is their a specific reason why the dynamic routes aren't supported?