extensions: Invalid trimming suppression in AIJsonUtilities

We have the following trimming suppression:

https://github.com/dotnet/extensions/blob/6487428046a2d7a5c8bb6034e97c38d6e0b7affa/src/Libraries/Microsoft.Extensions.AI.Abstractions/Utilities/AIJsonUtilities.Schema.cs#L193-L198

This is an incorrect way to address trimming warnings. The intention of the warnings is so developers now upfront what does and what doesn’t work when the build and publish a trimmed or native AOT’d app. Suppressing warnings like this minimizes the principle of “if you don’t get warnings during publish, your app is guaranteed to work the same as before you published”.

We should remove this suppression and either make the underlying code trim-compatible, or we should annotate this method as RequiresUnreferencedCode.

cc @eiriktsarpalis

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 15 (15 by maintainers)

Commits related to this issue

Most upvoted comments