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()
)
)
Description
Minimap reproducible example: