RESTful API routes design: nested vs. non-nested

前端 未结 3 933
星月不相逢
星月不相逢 2021-02-05 07:26

My question is about the advantages of nesting resources when building URLs for API purposes. Consider the following two alternatives for accessing an employee resource:

3条回答
  •  孤城傲影
    2021-02-05 07:51

    From my experience: Q1. Easier to use, hard to implement because of relational model Q2. Nested is better when it comes to permissions and others potential checks that you can do before you go levels down

提交回复
热议问题