Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring REST Docs 설정을 추가하라 #32

Merged
merged 4 commits into from
May 15, 2021

Conversation

truman-show
Copy link
Collaborator

@truman-show truman-show commented May 13, 2021

작업 내용

  • Spring REST Docs 설정을 추가했습니다.
  • 작업내용과 무관한 (Web<->App 과 구분을 짓기 위해 클래스 명을 변경하라) 이 포함된 점 양해 바랍니다.
  • gradlew applications:client-api:clean applications:client-api:build 명령어를 실행 후 생성된 jar 파일을 java -jar xxx.jar 로 실행 할 경우 아래 이미지를 확인 가능합니다.

image

Copy link
Collaborator

@yongjin5184 yongjin5184 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드의 수정 사항은 없어서, comment 달아주시고 merge 해주시면 됩니다!! 💯

@@ -0,0 +1,187 @@
= Caregiver Salrong API Document
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

와우 👍 👍


=== HTTP Status

link:https://tools.ietf.org/html/rfc7231#section-6[RFC7231] 에 많은 HTTP 응답코드가 정의되어 있지만, 너무 많은 응답코드는 개발자에서 혼란을 초래한다.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

토스 컨퍼런스에서 나온 이야기랑 똑같네요 ㅎ 인지하기 쉬운 응답만 사용한다. 💯
스크린샷 2021-05-15 오전 9 23 09

|===

NOTE: link:https://tools.ietf.org/html/rfc7231[RFC7231], link:https://ko.wikipedia.org/wiki/HTTP[위키백과] 에 근거하여 HTTP GET Method 에는 Request Body를 포함하지 않는다.
이러한 이유로 인해 조회 성격의 API 이지만 조회 쿼리가 복잡할 경우 POST Method 를 사용할 수 있다.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

어제 이거 관련해서 좀 찾아보다가 재미있는걸 찾았습니다.

가장 표를 많이 받은 글내용을 보면 GET 메서드에서 body를 사용해도된다라는 의견으로 이해가 되는데요.

@yongjin5184 님 의견은 어떠신가요?

HTTP GET with request body

|===
| Field | Type | Description

| `success`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

성공여부를 body 에 내려주는 이유가 뭔지 여쭤봐도 될까요~? 🤔
Http Status 만으로는 판단하기 어려운 경우가 있나요~?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네 맞아요 http status 로 만으로도 API 의 성공여부를 판단할 수 있습니다.

제가 success 필드를 추가한 이유는 클라이언트입장에서는 http status로 성공여부를 판단하는 거는

너무 많은 경우를 주는게 아닌가 라는 생각이 들어서 추가를 하였습니다.

@onemask 님 의견을 들어보면 좋을거같아요.

불필요한 필드라면 제거해도 좋습니다

@truman-show truman-show requested a review from onemask May 15, 2021 02:12
@truman-show
Copy link
Collaborator Author

success 필드 관련 이슈를 생성하였습니다.

해당 PR은 승인이 완료되었다고 판단되어 머지하도록 하겠습니다.

#35

@truman-show truman-show merged commit d22d0f9 into TuesdayGangnam:develop May 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants