Issue Bug Closed

#65527JSONView - _descend not working on multiple objects behind a variable

Rainer Amler 03/04/15, 22:59 updated 01/25/20, 22:37

Description

I’ve got the following data-structure

one Supercart -1:n-> got many carts -1:n-> got many Items

Now I want to use JSONVIEW to render each Object and all it’s subobjects.

If the parent contains only one child you can render the child.

Once you’ve got multiple children the routine breaks and you cannot access it’s subobjects.

here is my JSONVIEWCONFIGURATION:

$JsonViewConfiguration = [
            'applicationUser2Supercart' => [
                '_descend' => [
                    'supercart' => [
                        '_exposeObjectIdentifier' => TRUE,
                        '_descend' => [
                            'dateAdd' => [],
                            'carts' => [
                                '_exposeObjectIdentifier' => TRUE,
                                '_descend' => [
                                    'cartitems' => [
                                        '_descend'  => [
                                            'item'  => [],
                                        ],
                                    ],
                                    'dateAdd' => [
                                        '_only' => ['date'],
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
                '_exposeObjectIdentifier' => TRUE,
            ],
        ];

It should be possible to access all children and their children and all of their properties.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.