Skip to content

Commit 1545a7d

Browse files
committed
Suppress JsonPropertyAttribute
1 parent af460c2 commit 1545a7d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Analyzers/CSharp/Analysis/MakeMemberReadOnly/MakeMemberReadOnlyAnalyzer.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public sealed class MakeMemberReadOnlyAnalyzer : BaseDiagnosticAnalyzer
1616
{
1717
private static readonly MetadataName Microsoft_AspNetCore_Components_ParameterAttribute = MetadataName.Parse("Microsoft.AspNetCore.Components.ParameterAttribute");
1818
private static readonly MetadataName Microsoft_AspNetCore_Components_CascadingParameterAttribute = MetadataName.Parse("Microsoft.AspNetCore.Components.CascadingParameterAttribute");
19+
private static readonly MetadataName Newtonsoft_Json_JsonPropertyAttribute = MetadataName.Parse("Newtonsoft.Json.JsonPropertyAttribute");
1920

2021
private static ImmutableArray<DiagnosticDescriptor> _supportedDiagnostics;
2122

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

201202
if (attributeClass.HasMetadataName(Microsoft_AspNetCore_Components_CascadingParameterAttribute))
202203
return false;
204+
205+
if (attributeClass.HasMetadataName(Newtonsoft_Json_JsonPropertyAttribute))
206+
return false;
203207
}
204208

205209
return true;

0 commit comments

Comments
 (0)