Skip to content

version resilient model could not handle nested model in list or dict correctly #2034

@tadelesh

Description

@tadelesh

For example,

class ModelA(Model):
    prop1: List[ModelB] = rest_field()
    prop2: Dict[str, ModelC] = rest_field()

class ModelB(Model):
    prop3: str = rest_field()

class ModelC(Model):
    prop4: str = rest_field()

test = ModelA({"prop1": [{"prop3":"test3"}], "prop2": {"test": {"prop4": "test4"}}}

when we use test.prop1[0].prop3, it will fail in error, the correct return should be test3,
also test.prop2["test"].prop4 should return test4.

Metadata

Metadata

Assignees

Labels

bugThis issue requires a change to an existing behavior in the product in order to be resolved.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions