Skip to content

Validate that MetaMixin can only be used with sync controller and the opposite #141

@sobolevn

Description

@sobolevn

We have a TODO task:

def __call__(self, controller: 'type[Controller[BaseSerializer]]') -> bool:
"""Run the validation."""
# TODO: validate that sync controller have `MetaMixin`
# and async ones have `AsyncMetaMixin`
self._validate_components(controller)

It should not be possible to create

class My(MetaMixin, Controller[PydanticSerializer]):
    async def get(self) -> int: ...

and

class My(AsyncMetaMixin, Controller[PydanticSerializer]):
    def get(self) -> int: ...

Please, add a validation for this.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions