dapr / dapr/dotnet-sdk

[Topic] Attribute doesn't support dynamic routes

Open
#1,130 4 comments 0 reactions 0 assignees View on GitHub
area/aspnetcore question
Dominant language
C#
Stars
1.2k
Forks
378
Avg merge
2d 1h
Merged PRs (30d)
6

Description

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:**

```csharp
[ApiController]
[ApiVersion("1.0")]
[Route("api/v{v:apiVersion}/example]
public class ExampleController : ControllerBase
{
[HttpPost()]
[Topic("messagebus", "topic")
public async Task PubSub([FromBody] object message)
{
...
}
}
```

**Example static route:**
```csharp
[ApiController]
[Route("api/v1.0/example]
public class ExampleController : ControllerBase
{
[HttpPost()]
[Topic("messagebus", "topic")
public async Task PubSub([FromBody] object message)
{
...
}
}
```

Is their a specific reason why the dynamic routes aren't supported?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.