Skip to content

[AOT] ProblemDetails and Extension values #45862

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

Closed
JamesNK opened this issue Jan 4, 2023 · 5 comments
Closed

[AOT] ProblemDetails and Extension values #45862

JamesNK opened this issue Jan 4, 2023 · 5 comments
Labels
linker-friendliness Tracking linker friendliness NativeAOT old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels

Comments

@JamesNK
Copy link
Member

JamesNK commented Jan 4, 2023

Problem Details is an internet standard - https://www.rfc-editor.org/rfc/rfc7807

In ASP.NET Core, ProblemDetails is serialized with IProblemDetailsWriter. The default implementation is DefaultProblemDetailsWriter.

One of the concepts of problem details is extension data. These are arbitrary values that can be added to the payload. This is difficult with AOT because it's represented on ProblemsDetails as IDictionary<string, object>. Serializing problem details successfully (don't worry about deserializing, aspnetcore doesn't do that) means all the values in the directory must have generated code registered with the serializer.

@JamesNK JamesNK added linker-friendliness Tracking linker friendliness NativeAOT old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels labels Jan 4, 2023
@JamesNK
Copy link
Member Author

JamesNK commented Jan 4, 2023

ProblemDetails.Extensions is annotated to warn that types set in it are serialized, and that there maybe problems with serializing because values aren't able to be statically analyzed.

If there are changes to remove ProblemDetails.Extensions warning, then make sure to remove suppressions that come from using it. Right now, that is DeveloperExceptionPageMiddlewareImpl.

@halter73
Copy link
Member

halter73 commented Jan 5, 2023

Triage: We want to try to remove the annotations ProblemsDetails.Extensions possibly by flowing the user's JsonTypeInfo registrations when serializing ProblemDetails.

@captainsafia captainsafia added this to the .NET 8 Planning milestone Jan 12, 2023
@ghost
Copy link

ghost commented Jan 12, 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.

@brunolins16
Copy link
Member

@JamesNK I believe this issue was fixed by #45886 as #45906, right?

@JamesNK
Copy link
Member Author

JamesNK commented Jan 26, 2023

Yup

@JamesNK JamesNK closed this as completed Jan 26, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Feb 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
linker-friendliness Tracking linker friendliness NativeAOT old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Projects
None yet
Development

No branches or pull requests

4 participants