Skip to content
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

RDG does not support route handlers that return an anonymous type #47244

Open
captainsafia opened this issue Mar 16, 2023 · 4 comments
Open

RDG does not support route handlers that return an anonymous type #47244

captainsafia opened this issue Mar 16, 2023 · 4 comments
Labels
area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc bug This issue describes a behavior which is not expected - a bug. feature-rdg
Milestone

Comments

@captainsafia
Copy link
Member

Given the code:

app.MapGet("/", () => new { Name = "Tester"});

The RDG will generate code that fails to comply because of the anonymous type is unspeakable.

@captainsafia captainsafia added bug This issue describes a behavior which is not expected - a bug. area-web-frameworks feature-rdg labels Mar 16, 2023
@captainsafia captainsafia added this to the .NET 8 Planning milestone Mar 16, 2023
@ghost
Copy link

ghost commented Mar 16, 2023

Thanks for contacting us.

We're moving this issue to the .NET 8 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@captainsafia
Copy link
Member Author

I'm taking a look at getting this working by taking advantage of the interceptors prototype that is in https://github.com/dotnet/aspnetcore/tree/safia/interceptors-prototype.

The first onion to peel is that at the moment, we don't have access to a speakable type name for the anonymous types in two locations.

  • The strongly-typed endpoint definition
  • The cast from Delegate to the strongly typed handler that can be invoked with parameters

Interceptors solve the first problem but we still have the second issue to contend with.

@captainsafia
Copy link
Member Author

Update: we realized that even if we get this working from RDG's perspective, the JSON generator still lacks support for anonymous types so we're likely to deadend here.

Moving this issue to Low/never since we can't take any action immediately. We already emit a diagnostic so we are good there.

@captainsafia captainsafia modified the milestones: .NET 8 Planning, Backlog Apr 26, 2023
@ghost
Copy link

ghost commented Apr 27, 2023

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@amcasey amcasey added the area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc label Jun 2, 2023
@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
@wtgodbe wtgodbe removed the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
@wtgodbe wtgodbe removed the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 13, 2024
@dotnet dotnet deleted a comment from dotnet-policy-service bot Feb 13, 2024
@dotnet dotnet deleted a comment from dotnet-policy-service bot Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc bug This issue describes a behavior which is not expected - a bug. feature-rdg
Projects
None yet
Development

No branches or pull requests

4 participants
@captainsafia @amcasey @wtgodbe and others