Skip to content

Instantly share code, notes, and snippets.

View Josrph's full-sized avatar

Joseph Josrph

View GitHub Profile
@Josrph
Josrph / RefitRouteAnalyzer.cs
Last active November 9, 2022 17:55
Roslyn-based Refit Route Analyzer.
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class RefitRouteAnalyzer : DiagnosticAnalyzer
{
private const string Category = "Routing";
public const string DiagnosticId = "RefitRouteAnalyzer";
private static readonly DiagnosticDescriptor AttributeRule = new DiagnosticDescriptor(
DiagnosticId,
title: "Route string should match method signature",
messageFormat: "Attribute name '{0}' contains incorrect route",