-
Notifications
You must be signed in to change notification settings - Fork 704
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
Issue when using AddApiExplorer and JsonTranscoding #1109
Comments
I would be very surprised that anything about
I would have expected [ApiController]
[ApiVersion(2.0)]
[Produces("application/json")]
[Route("api/v{version:apiVersion}/controller")]
public class V2Controller : Controller
{
[HttpGet("{param}/route""]
public IActionResult GetEndpoint(string param) => Ok("ok get v2");
}
I'm not sure I understand exactly how ProtoBuf matches up to a controller. Is that code-generated? I suspect that the next problem is a mismatch in names. API Version collation is performed on logic name, not route template. Route template may seem intuitive, but there are many nuances. By default, ASP.NET Core uses the suffix convention
My recommendation for your next steps is to:
|
Hi, thanks for taking your time to answer me. This is just an example i've put together just to show that is reproducible. I created the same issue in the grpc repo but i havent heard from them. (See: grpc/grpc-dotnet#2500) |
I followed your suggestions and updated the project i wrote. I got the same behaviour. It would be great if we, at least, can rule out the versioning library as the problem. |
Is there an existing issue for this?
Describe the bug
Hey guys, i'm having a problem with a project i'm working on and i wanted to see if i'm missing anything or maybe i've stumbled on a bug.
I have created a minimal project where i'm able to reproduce the behaviour, I'm goint to try to guide you pasting snippets of code here.
When i run the program, and try to hit the endpoint v2 with postman everything goes as expected.
But, instead, if i call v1, which should be responded by the jsontranscode, i get 404.
I've tracked this down to the call of AddApiExplorer. If i remove that call i'm able to get the v1 as i should.
What do you think about this? Is this the expected behaviour? Am i doing something wrong? Is this a bug? If it is, is a bug in the jsontranscoding or asp.versioning library?
Thank you so much for your time and sorry the lenght of this post. Let me know if you need anything else that could help you answering this.
Expected Behavior
Endpoint is found and executed.
Steps To Reproduce
Program.cs
V2Controller.cs
And greet.proto (This is the wiki example as you can see, just added the route i need to demostrate my point)
Exceptions (if any)
No response
.NET Version
8.0.304
Anything else?
No response
The text was updated successfully, but these errors were encountered: