{"action":"created","issue":{"url":"https://api.github.com/repos/spring-projects/spring-hateoas/issues/270","labels_url":"https://api.github.com/repos/spring-projects/spring-hateoas/issues/270/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-hateoas/issues/270/comments","events_url":"https://api.github.com/repos/spring-projects/spring-hateoas/issues/270/events","html_url":"https://github.com/spring-projects/spring-hateoas/issues/270","id":51499105,"number":270,"title":"Sample for embedding HAL Resources of different types with root resource","user":{"login":"anywhereinfo","id":1041183,"avatar_url":"https://avatars.githubusercontent.com/u/1041183?v=3","gravatar_id":"","url":"https://api.github.com/users/anywhereinfo","html_url":"https://github.com/anywhereinfo","followers_url":"https://api.github.com/users/anywhereinfo/followers","following_url":"https://api.github.com/users/anywhereinfo/following{/other_user}","gists_url":"https://api.github.com/users/anywhereinfo/gists{/gist_id}","starred_url":"https://api.github.com/users/anywhereinfo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anywhereinfo/subscriptions","organizations_url":"https://api.github.com/users/anywhereinfo/orgs","repos_url":"https://api.github.com/users/anywhereinfo/repos","events_url":"https://api.github.com/users/anywhereinfo/events{/privacy}","received_events_url":"https://api.github.com/users/anywhereinfo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2014-12-09T23:47:37Z","updated_at":"2015-10-05T17:27:30Z","closed_at":null,"body":"Hi,\r\nGoogle is full of questions around how to create embedded HAL resources of different types inside the main root resource. I looked at the Resources Interface, but that can only be leveraged by same types to model collection of a particular type.\r\nI am currently using Spring-Hateoas to create a nested resource hierarchy and creating \"_embedded\" jsonproperty looks like a hack. Spring Data Rest has support for embedding entities, so it will be really helpful if you could please create a sample for embedding different type of single and collection of resources within a root resource."},"comment":{"url":"https://api.github.com/repos/spring-projects/spring-hateoas/issues/comments/145605386","html_url":"https://github.com/spring-projects/spring-hateoas/issues/270#issuecomment-145605386","issue_url":"https://api.github.com/repos/spring-projects/spring-hateoas/issues/270","id":145605386,"user":{"login":"aglassman","id":1435196,"avatar_url":"https://avatars.githubusercontent.com/u/1435196?v=3","gravatar_id":"","url":"https://api.github.com/users/aglassman","html_url":"https://github.com/aglassman","followers_url":"https://api.github.com/users/aglassman/followers","following_url":"https://api.github.com/users/aglassman/following{/other_user}","gists_url":"https://api.github.com/users/aglassman/gists{/gist_id}","starred_url":"https://api.github.com/users/aglassman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aglassman/subscriptions","organizations_url":"https://api.github.com/users/aglassman/orgs","repos_url":"https://api.github.com/users/aglassman/repos","events_url":"https://api.github.com/users/aglassman/events{/privacy}","received_events_url":"https://api.github.com/users/aglassman/received_events","type":"User","site_admin":false},"created_at":"2015-10-05T17:27:30Z","updated_at":"2015-10-05T17:27:30Z","body":"I'd be interested in seeing a feature similar to what @anywhereinfo describes above.\r\n> ... perhaps having Resource Representation Annotations, that can be placed on a Resource, would help to determine whether to embed Resources or not?\r\n\r\nI'm currently using spring-data-rest, and there seems to be no easy way to specify if a child resource should appear in the _embedded object.  "}}