TGViewer
Находки в опенсорсе: Python Находки в опенсорсе: Python @opensource_findings_python · 1.06K subscribers
Post #237 504
🚀 New issue to wemake-services/django-modern-rest by @LesPrimus
📝 UnsolvableAnnotationsError when subclassing a concrete Controller subclass` (#873)


What's wrong?

Bug: UnsolvableAnnotationsError when subclassing a concrete Controller subclass

Description

When creating an intermediate concrete controller class and then subclassing it,
__init_subclass__ raises UnsolvableAnnotationsError even though the serializer
is already resolved on the parent.

Reproduction

from dmr import Controller
from dmr.plugins.pydantic import PydanticSerializer
from dmr.serializer import BaseSerializer


class BaseController[T: BaseSerializer](Controller[T]):
pass


class PydanticController(BaseController[PydanticSerializer]):
pass


# This raises UnsolvableAnnotationsError
class UserController(PydanticController):
def get(self) -> ...:
...

Error

dmr.exceptions.UnsolvableAnnotationsError: Type args () are not correct for <class 'UserController'>,
at least 1 type arg must be provided

Expected behavior

UserController should inherit the serializer from its concrete parent PydanticController,
which already has serializer = PydanticSerializer set.


--

Thanks for the awesome library, I just started exploring it and I'm really enjoying it so far!

--

### How it should be?

Subclassing a concrete `Controller` subclass (one that already has a resolved serializer)
should work without requiring the type argument to be re-specified.

`UserController(PydanticController)` should behave the same as `UserController(BaseController[PydanticSerializer])`.

### Used versions

- `django-modern-rest==0.5.0`
- `Python 3.14.0`

### OS information

- `Linux tuxedo-stellaris 6.17.0-111019-tuxedo x86_64 (Ubuntu 24.04)`


#bug #good_first_issue #help_wanted #django_modern_rest
sent via relator
More from @opensource_findings_python
  1. Sep 24, 2026🚀 New issue to wemake-services/django-modern-rest by @sobolevn 📝 Flaky `test_empty_valid…
  2. Sep 24, 2026🚀 New issue to wemake-services/django-modern-rest by @sobolevn 📝 `CookieJWT[A]syncAuth`…
  3. Sep 23, 2026🚀 New issue to ag2ai/faststream by @IvanKirpichnikov 📝 Feature: Implementation of the `A…
  4. Sep 22, 2026🚀 New issue to faststream-community/zMQTT by @borisalekseev 📝 Mark flaky Artemis test xf…
  5. Sep 17, 2026Помните про https://github.com/ozeranskii/httptap? Я писал о нем давно еще - > тут. Наклеп…
  6. Sep 15, 2026🚀 New issue to wemake-services/django-modern-rest by @sobolevn 📝 `test_custom_union_form…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →