개발

REST API에 Under_Score(_)? Hyphen(-)?

Ridiss 2023. 5. 18. 07:49

 

 

일단 결론은

언더바, 하이픈 상관없지만 하이픈을 쓰는게 좋다. 입니다.

 

 

구글에서 REST API 규칙을 검색하면 대부분

 

이러한 내용이 나오는데 저런 룰을 어디서 정하였는지에 대해서는 확실한 근거가 없습니다.

RFC3986 문서내용을 봐도 둘 다 허용을 하고 있습니다.

https://www.rfc-editor.org/rfc/rfc3986

 

RFC 3986: Uniform Resource Identifier (URI): Generic Syntax

 

www.rfc-editor.org

 

 

그래도 이유가 있겠거니.. 하고 조금더 검색해보았는데 

 

!!

 

https://www.siteguru.co/seo-academy/underscores-or-hyphens-for-seo-urls

구글 검색엔진에서는 하이픈으로 구분한다고 합니다.

 

 

 

참고로 아래와 같이 더블클릭시 이러한 차이가 있습니다.

Double-click this in Chrome: camelCase
Double-click this in Chrome: under_score
Double-click this in Chrome: hyphen-ated

 

끝.