Skip to content

Serialize objects #5

@cuyogomez

Description

@cuyogomez

Hi people. i have a problem... I have a Brand Object with name and id attributes. Then i have a Car with name, color, and foreign key to Brand Object. I need to return a JSON response with a list of Brands and foreach brand display all the cars, but when i do that, my response is
[
{
id:"1",
name:"Ford",
cars:
[
{Car object},
{Car object}
]
}
]

So, the Car object isn't serialized... how can i do that??? Please is urgent!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions