Browse Source
🐛 Fix typing for `CustomORJSONResponse.media_type`
* Declare `media_type` as `ClassVar[str]`, importing `ClassVar` from `typing`.
* Treats the attribute as a class-level constant, matching FastAPI’s built-in response classes and silencing mypy/ruff strict-mode errors.
* Prevents rare `AttributeError` scenarios when `Response` subclasses are instantiated before the attribute is set.
* No runtime behaviour change; purely a correctness/compatibility fix.
pull/13879/head
committed by
GitHub
1 changed files with 2 additions and 2 deletions
Loading…
Reference in new issue