Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotated SerializationStrategy used as a field serialization strategy leads to RecursionError #219

Closed
Fatal1ty opened this issue Apr 28, 2024 · 0 comments · Fixed by #220
Labels
bug Something isn't working

Comments

@Fatal1ty
Copy link
Owner

  • mashumaro version: 3.12
  • Python version: 3.12.2
  • Operating System: macOS 14.4

Description

Minimap reproducible example:

from typing import Any

from dataclasses import dataclass, field
from mashumaro import DataClassDictMixin, field_options
from mashumaro.types import SerializationStrategy


class MySerializationStrategy(SerializationStrategy, use_annotations=True):
    def serialize(self, value: Any) -> Any:
        return value

    def deserialize(self, value: Any) -> Any:
        return value


@dataclass
class MyClass(DataClassDictMixin):
    x: int = field(
        metadata=field_options(
            serialization_strategy=MySerializationStrategy()
        )
    )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant