Azure / Azure/azure-sdk-tools

[Python APIView] Enum metaclass is not rendered in class definition

Open
#14,306 1 comment 0 reactions 0 assignees View on GitHub
APIView customer-reported Python question
Dominant language
C#
Stars
135
Forks
260
Avg merge
3d 1h
Merged PRs (30d)
143

Description

**Bad code snippet:**
```python
class azure.ai.projects.models.AzureAISearchQueryType(str, Enum):
```

**Description:**
The APIView parser is incorrectly rendering the Enum class definition without the required `metaclass=CaseInsensitiveEnumMeta`. This prevents case-insensitive string matching for enum values, which is required by guidelines.

**Expected (good) code snippet:**
```python
class azure.ai.projects.models.AzureAISearchQueryType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
```

Please update the parser to correctly render the metaclass in Enum definitions.

Contributor guide

Open the contributing guide

Research direction

Start by locating the APIView parser and its Python enum class-definition rendering path. Compare output for AzureAISearchQueryType with the expected metaclass form, then run the parser's relevant tests or fixture checks; done means the rendered definition includes CaseInsensitiveEnumMeta and preserves case-insensitive enum matching.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.