-
2021.11.29 기록장TIL 2021. 11. 29. 22:17
ToDo
- 책 읽기
Done
- 책 읽기
Weekly goal
- 책 읽기
- 영어 레퍼런스 읽기
- 북마크 읽기, 정리
URL 접근법
여태 url을 설정할 때 계층 구조를 만드는 것이 rest API 철학에 맞는다고 생각을 했다.
예로 /customers/1/orders/99/products
처럼 타고 타고 가는 것이다. 헌데 이는 유연성을 떨어뜨린다.
또 로이 필딩은 uri에 대해 서버에서 자유롭되 규칙을 갖는 것을 말했다.
REST API Design Best Practices for Sub and Nested Resources
REST API design best practices for nested resources
www.moesif.com
https://stackoverflow.com/questions/20951419/what-are-best-practices-for-rest-nested-resourcesWhat are best practices for REST nested resources?
As far as I can tell each individual resource should have only one canonical path. So in the following example what would good URL patterns be? Take for an example a rest representation of Compan...
stackoverflow.com
https://stackoverflow.com/questions/19340488/rest-api-design-nested-collection-vs-new-root
REST API Design: Nested Collection vs. New Root
This question is about optimal REST API design and a problem I'm facing to choose between nested resources and root level collections. To demonstrate the concept, suppose I have collections City,
stackoverflow.com
https://docs.microsoft.com/en-us/azure/architecture/best-practices/api-design
Web API design best practices - Azure Architecture Center
Learn the best practices for designing web APIs that support platform independence and service evolution.
docs.microsoft.com
https://www.moesif.com/blog/technical/api-design/REST-API-Design-Best-Practices-for-Sub-and-Nested-Resources/
REST API Design Best Practices for Sub and Nested Resources
REST API design best practices for nested resources
www.moesif.com
https://www.youtube.com/watch?v=RP_f5dMoHFc
가장 깔끔한 구조인 것 같다.
글을 읽다보면 collections을 2번 이상 타지마 라 등의 이야기가 있는데
위의 사진이 명확한 예시를 보여준다.
'TIL' 카테고리의 다른 글
2021.12.04~06기록장 (0) 2021.12.03 2021.12.03 기록장 (0) 2021.12.03 2021.11.22 기록장 (0) 2021.11.21 2021.11.21 기록장 (0) 2021.11.19 2021.11.18 기록장 (0) 2021.11.17