The RepositoryRestResource annotation in Spring creates endpoints on a defined path fragment, e.g.
@RepositoryRestResource(path = "expenses")
would create endpoints like:
/expenses
/expenses/search
/expenses/1
Is there a way to include a path parameter in that repository? I want to see expenses only related to a specific user, e.g. "michael":
/users/michael/expenses
/users/michael/expenses/search
/users/michael/expenses/1
EDIT 1
I managed to get halfway there by using the same annotation on the User
, which results in the right endpoint:
/users/1/expenses
BUT I cannot POST anything on that resource - the server answers with empty body.