twreporter/tr-projects-rest

response should be nested.

Closed this issue · 3 comments

Currently if I get single article back by http://${host:port}/posts/${id}, the response be like the following json object

{
    relateds: [],
    _updated: "Thu, 01 Jan 1970 00:00:00 GMT",
    style: "article",
    byline: "",
    subtitle: "",
    name: "test",
    tags: [
        "56d6f9dfdfc9580f0c6066ba"
    ],
    title: "",
    publishedDate: "Thu, 14 Apr 2016 04:26:21 GMT",
    content: {
       ...
    },
    state: "published",
    og_description: "",
    _links: {
      ...
    },
    authors: [
        "571ede3874ae22f42a8da30a",
        "571ede4774ae22f42a8da30b"
    ],
    og_title: "",
    _id: "570f1beddb0ab7b51b7680c5",
    slug: "test",
    categories: [],
    _created: "Thu, 01 Jan 1970 00:00:00 GMT"
}

However, nested entity field like tags and authors will only show id, rather than the complete json object.

Please help to return the response with nested entities.

@hcchien

you can check the README.md.

it should be working with the request like:
http://localhost:8080/posts?embedded={'authors':1,'tags':1,'categories':1}

that example seems kind of wrong.
' should be ".