Fix dict body validation x2

This commit is contained in:
2025-10-16 22:19:42 +03:00
parent 4068af462b
commit 9775bc2cc6
4 changed files with 20 additions and 2 deletions

View File

@@ -44,6 +44,20 @@ def test_unions():
assert a['a'] == '42a'
def test_dict_body():
@dataclass
class A:
a: dict[str, float]
defl = SchemaDeflatorGenerator()
fn = defl.schema_to_deflator(A)
a = fn(A({'1': 1.1, '2': 2.2}))
print(a)
assert a['a']['1'] == 1.1
assert a['a']['2'] == 2.2
@dataclass
class CircA:
b: CircB