Skip to content

Commit

Permalink
Suppress JsonPropertyAttribute
Browse files Browse the repository at this point in the history
  • Loading branch information
josefpihrt committed May 10, 2022
1 parent af460c2 commit 1545a7d
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public sealed class MakeMemberReadOnlyAnalyzer : BaseDiagnosticAnalyzer
{
private static readonly MetadataName Microsoft_AspNetCore_Components_ParameterAttribute = MetadataName.Parse("Microsoft.AspNetCore.Components.ParameterAttribute");
private static readonly MetadataName Microsoft_AspNetCore_Components_CascadingParameterAttribute = MetadataName.Parse("Microsoft.AspNetCore.Components.CascadingParameterAttribute");
private static readonly MetadataName Newtonsoft_Json_JsonPropertyAttribute = MetadataName.Parse("Newtonsoft.Json.JsonPropertyAttribute");

private static ImmutableArray<DiagnosticDescriptor> _supportedDiagnostics;

Expand Down Expand Up @@ -200,6 +201,9 @@ private static bool AnalyzePropertyAttributes(IPropertySymbol propertySymbol)

if (attributeClass.HasMetadataName(Microsoft_AspNetCore_Components_CascadingParameterAttribute))
return false;

if (attributeClass.HasMetadataName(Newtonsoft_Json_JsonPropertyAttribute))
return false;
}

return true;
Expand Down

0 comments on commit 1545a7d

Please sign in to comment.