Skip to content

How do you Deserialize Nested Data? #92

@mikey-no

Description

@mikey-no

Assuming this is a valid question. How do I load one dictionary nested in another?

i.e.

    in_p1 = { "id": 1, "name": "Parent 1", "children": { "id": 1, "name": "Child 2" }}
    p1 = Parent.new_from_dict(in_p1);
    pprint(p1, indent=3)

Both Parent and Child models are defined and work individually but not together. The relationship between children and parents are also defined and this too works but not with any of the create_new_instance methods.

Have I missed something?

Thanks

Mike

Metadata

Metadata

Labels

questionFurther information is requested

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions