Skip to content

Commit

Permalink
Add suppression message to JSON serialization (dotnet#47908)
Browse files Browse the repository at this point in the history
This was missed in dotnet#47859 and is causing trimming/AOT warnings from generated code.
  • Loading branch information
eerhardt authored Apr 26, 2023
1 parent 509ba52 commit e821f20
Show file tree
Hide file tree
Showing 28 changed files with 84 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,9 @@ private static EndpointFilterDelegate BuildFilterDelegate(EndpointFilterDelegate
return filteredInvocation;
}
[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1704,6 +1704,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ namespace Microsoft.AspNetCore.Http.Generated
return filteredInvocation;
}

[UnconditionalSuppressMessage("Trimming", "IL2026:RequiresUnreferencedCode",
Justification = "The 'JsonSerializer.IsReflectionEnabledByDefault' feature switch, which is set to false by default for trimmed ASP.NET apps, ensures the JsonSerializer doesn't use Reflection.")]
[UnconditionalSuppressMessage("AOT", "IL3050:RequiresDynamicCode", Justification = "See above.")]
private static Task ExecuteObjectResult(object? obj, HttpContext httpContext)
{
if (obj is IResult r)
Expand Down

0 comments on commit e821f20

Please sign in to comment.