Should a resource be available through more than one URL endpoint?
For instance, I have exam resources which contain multiple question resources which in turn contain multiple answer resources. The endpoints to list questions and view a single question are as follows:
/api/exams/{exam_id}/questions /api/exams/{exam_id}/questions/{question_id} However, it also makes sense to be able to view a single question with an endpoint like:
/api/questions/{question_id} Is it a bad idea to support additional endpoints for a single resource? If it is a bad idea, I think I'd rather have complex endpoints for collections and single resources because it seems inconsistent to simplify just one endpoint and have the following:
/api/exams/{exam_id}/questions /api/questions/{question_id} Going even further, there's also the complexity of multiple answer resource endpoints.
/api/exams/{exam_id}/questions/{question_id}/answers /api/exams/{exam_id}/questions/{question_id}/answers/{answer_id} /api/questions/{question_id}/answers /api/questions/{question_id}/answers/{answer_id} /api/answers/{answer_id}