I'm using a Spring Data REST backend with AngularJs as frontend. How is the best way to add sub-resources to a "root Entity"?
From official documentation section 4.4.1: http://docs.spring.io/spring-data/rest/docs/2.3.0.RELEASE/reference/html/#repository-resources.search-resource we can POST to association resource using "text/uri-list"
A tipical example of sub-resource are Comments to a BlogPost like this question: POSTing a @OneToMany sub-resource association in Spring Data REST
From Spring documentation I should proceed in two steps:
- add the new sub-resource (POST a new Comment)
- and then add the link (POST a text/uri-list to the BlogPost comments)