-
Notifications
You must be signed in to change notification settings - Fork 208
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
[Feature Request] Overloaded GetForUserAsync that takes a JsonTypeInfo<T> as a parameter to enable source generated Json deserialization (For NativeAOT compliance) #2930
Comments
This sounds right. Only question I have is how many of the other interfaces should we patch in the same release. |
@keegan-caruso DownstreamApi.cs DownstreamApi.HttpMethods.cs DownstreamWebApiGenericExtensions.cs Microsoft.Identity.Web.TokenAcquisition\TokenAcquisition.cs Microsoft.Identity.Web\WebAppExtensions\MicrosoftIdentityWebAppAuthenticationBuilder.cs |
the ones in DownstreamApi.cs and DownstreamApi.HttpMethods.cs should be I would not do it for the last two:
|
…enable source generated Json deserialization for NativeAOT (#131) AzureAD/microsoft-identity-web#2930 Adding overloads to IDownstreamApi that accept JsonTypeInfo for inputs / outputs so that source generated Json serialization can work in a NativeAOT context.
Just curious how this was fixed? I see a draft PR still open for this topic. |
This is still open - the prerequisite PR in abstractions has been merged and release but this PR implements the changes in microsoft-identity-web #2959 |
…ameter to enable source generated Json deserialization for NativeAOT (#2959) Addresses #2930 Update Microsoft.Identity.Abstractions to 7.0.0 Implementation for new DownstreamApi interfaces in Microsoft.Identity.Abstractions for source gen Json serialization. Implementaitons are generated or copied as the existing with just the addition of jsonTypeInfo params
Is your feature request related to a problem? Please describe.
microsoft-identity-web emits NativeAOT trim warnings when GetForUserAsync is called from a NativeAOT compiled library. This is caused by using generics for JSON serialization/deserialization in DownstreamApi.cs.
Describe the solution you'd like
Public interfaces (particularly GetForUserAsync) should accept a JsonTypeInfo so that source generation can be used for Json serialization in a NativeAOT context.
Existing interfaces should be marked with the [RequiresUnreferencedCode] attribute. New interfaces that accept JsonTypeInfo should be made available only for net8+.
Example change for IDownstreamApi:
Describe alternatives you've considered
Open to suggestions
Additional context
There is a short term need for GetForUserAsync to be NativeAOT compliant - but there are other interfaces with AOT warnings that could require similar changes. Will follow up with more details on this
The text was updated successfully, but these errors were encountered: