[Python APIView] Constructor parameter type is incorrectly rendered as Mapping instead of Literal
- Dominant language
- C#
- Stars
- 135
- Forks
- 260
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 144
Description
**Bad code snippet:**
```python
def __init__(self, mapping: Mapping[str, Any]) -> None
```
**Description:**
The APIView parser incorrectly renders the constructor parameter as `mapping: Mapping[str, Any]`. According to the architect's feedback, this should be rendered as a literal type for consistency, specifically:
**Good code snippet:**
```python
def __init__(self, *, type: Literal[ToolChoiceParamType.APPLY_PATCH]) -> None
```
Please update the parser to correctly render literal types in constructor parameters.
Contributor guide
Research direction
Start with the APIView parser and reproduce the issue using the bad and good Python constructor snippets in the report. Trace how constructor parameter annotations are rendered; done means the parameter is emitted as the specified Literal type rather than Mapping[str, Any].
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100