I have a list of courses
with a list of students
. The idea is that a student can attend multiple courses.
The requirement is to return a unified list of courses-students where the "key" is like courseId + studentId
. The GET result will be like:
- courseId, courseName, studentId, studentName,...
My question is, which is the best approach to define this REST GET method. I have two solutions and any idea is welcome.
GET:api-name/v1/courses/students?version=5
- mening return from all courses the all studentsGET:api-name/v1/courses-students?version=5
- in this case, is a dedicated method as courses-students
Any idea is welcome. Many thanks!
Update: I was going to use solution 2. Also, the remark that this relation could be considered a new resource is a strong argument.