Azure / Azure/azure-sdk

[C# APIView] Static reaction types are incorrectly flagged as needing an enum

Open
#10,049 0 comments 0 reactions 0 assignees View on GitHub
customer-reported needs-triage question
Dominant language
PowerShell
Stars
597
Forks
374
Avg merge
5d 21h
Merged PRs (30d)
42

Description

Bad code snippet:
```csharp
public static class ReactionTypes {
```

This APIView comment is misrepresenting the code by claiming that known value sets must use an enum (or readonly struct if extensible). The architect noted that this guidance is out-of-date, and that using string literals/static value-holder classes is valid in many .NET types.

Good code snippet:
```csharp
public static class ReactionTypes
{
public const string Like = "like";
public const string Love = "love";
}
```

Contributor guide

Open the contributing guide

Research direction

Start at the C# APIView Copilot guidance or check that produces the enum comment, using the bad static class snippet as a reproduction. Compare its behavior with the static const-string example; done means valid static value-holder classes no longer receive the enum warning while the guidance remains accurate for cases that do require an enum.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.