-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
system.InvalidCastException: Unable to cast object of type 'Microsoft.AspNetCore.Routing.Patterns.RoutePatternParameterPart' to type 'Microsoft.AspNetCore.Routing.Patterns.RoutePatternLiteralPart'. #791
Comments
Removing or hardcoding the
|
@fbridger Yes, it can be solved. Apiversion cannot be supported |
@saber-wang - Given the fix, does this work for you? Or do you think we should have the direct support for |
@halspang If you can support, this is the best. If you can't, I'll use hard coding😉 |
Any Update for this ? |
@saber-wang Thank you I got the point, but what if app only subscribes to the latest version? |
@itsoli91 The version of the topic is independent of the SDK. In addition, you can refer to the cloud event version #868 route-messages |
Hello, we have also encountered this problem. We would like to have the ability to define multiple api versions within a controller and also map them to the pub sub model of dapr. As far as I understand the ASP.net implementation, I can do the following: [ApiController]
[ApiVersion("1.0")]
[ApiVersion("2.0")]
[route("api/v{v:apiVersion}/test")]
public class TestController : ControllerBase
{
[Topic(DaprComponents.PubSub, "pubsub-test")]
[HttpPost("pubsub")]
[MapToApiVersion("1.0")]
public IActionResult PubSubTest()
{
return Ok("PubSubTest");
}
[Topic(DaprComponents.PubSub, "pubsub-test")]
[HttpPost("pubsub2")]
[MapToApiVersion("2.0")]
public IActionResult PubSubTest2()
{
return Ok("PubSubTest2");
}
} I have defined two versions within the controller and mapped the two actions to a specific version each. I would now expect the Dapr Topic subscription to use the version defined using Right now, DaprEndpointRouteBuilderExtensions:201 is trying to turn the path segment into a Is there a plan to support these parameters in the near future? |
Error reporting using apiversion
access /dapr/subscrib
error:
The text was updated successfully, but these errors were encountered: