You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import jsons
from dataclasses import dataclass
from typing import List
@dataclass
class GenericStrategy():
pass
@dataclass
class GoodStrategy(GenericStrategy):
pass
@dataclass
class Containee():
strategy: GenericStrategy
@dataclass
class Container():
containees: List[Containee]
a = Container(containees=[Containee(strategy=GoodStrategy())])
b = jsons.dumps(a, verbose=True)
c = jsons.loads(b)
Based on my understanding, the object c at the end should have a GoodStrategy in c.containees[0].strategy, but instead it has a GenericStrategy. I believe this is a minimal example, nesting without using List doesn't seem to cause the problem.
I am using a workaround for my project. Just wanted to let you know. Thanks for making this library.
The text was updated successfully, but these errors were encountered:
milkshakeiii
changed the title
Nested types involving lists lost in verbose serialization
Nested types involving lists lost in verbose serialization/deserialization
Jan 31, 2022
Based on my understanding, the object c at the end should have a GoodStrategy in c.containees[0].strategy, but instead it has a GenericStrategy. I believe this is a minimal example, nesting without using List doesn't seem to cause the problem.
I am using a workaround for my project. Just wanted to let you know. Thanks for making this library.
The text was updated successfully, but these errors were encountered: