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

[feat] : 테스트 코드를 수정하여 REST Docs에 설명을 추가한다 #60

Merged
merged 6 commits into from
Nov 8, 2024

Conversation

bbbang105
Copy link
Member

✅ PR 유형

어떤 변경 사항이 있었나요?

  • 새로운 기능 추가
  • 버그 수정
  • 코드에 영향을 주지 않는 변경사항(오타 수정, 탭 사이즈 변경, 변수명 변경)
  • 코드 리팩토링
  • 주석 추가 및 수정
  • 문서 수정
  • 빌드 부분 혹은 패키지 매니저 수정
  • 파일 혹은 폴더명 수정
  • 파일 혹은 폴더 삭제

📝 작업 내용

이번 PR에서 작업한 내용을 간략히 설명해주세요(이미지 첨부 가능)

기존 스키마 (스키마명 & 설명 커스텀 X)

기존-스키마x,설명x

변경 후 스키마

변경-스키마o,설명o

쿼리 파라미터 예시 및 타입 설명 추가

예시추가
  • RequestBody에 대해서는 자동으로 Example이 생성되었으나, 쿼리 파라미터에 대해서는 그렇지 않았음
  • 때문에 예시 결과가 나올 수 있는 예시 파라미터를 넣어볼 수 있도록 설명에 추가함
  • 또한 쿼리 파라미터는 타입 지정이 되지 않아 String으로만 표현되어 헷갈릴 수 있기에, NUMBER 타입에 대해서는 명시함

✏️ 관련 이슈

본인이 작업한 내용이 어떤 Issue Number와 관련이 있는지만 작성해주세요


🎸 기타 사항 or 추가 코멘트

@bbbang105 bbbang105 added 🚀 feat 새로운 기능 추가 / 일부 코드 추가 / 일부 코드 수정 (리팩토링과 구분) / 디자인 요소 수정 🤯 SANGHO 상호 Issue or PR labels Nov 8, 2024
@bbbang105 bbbang105 requested a review from juuuunny November 8, 2024 07:58
@bbbang105 bbbang105 self-assigned this Nov 8, 2024
Copy link
Contributor

@juuuunny juuuunny left a comment

Choose a reason for hiding this comment

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

LGTM!!
완전 자세하게 잘 바꿔줬네요
감사합니다!!

Copy link
Contributor

Choose a reason for hiding this comment

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

문서화 시 더 상세하게 적어주는 것 좋네요.
전 최대한 간단히 적었었긴 한데 문서화해서 클라이언트측에 보여줄 때 더 이해하기도 쉽고 좋을 것 같아서
저도 나중에 추가할 때 더 상세히 문서화 해야겠어요.

"포토카드",
List.of("선수들의 사진을 뽑을 수 있는 포토카드! 경기 시작 전에 포토카드 기계로 가서 포토카드를 뽑을 수 있어요."),
List.of("기계의 QR을 통해 원하는 선수나, 자신의 사진으로 커스텀 포토카드를 뽑을 수 있으니 참고하세요!")
);
GetEntertainmentsResponseDto getEntertainmentsResponseDto = GetEntertainmentsResponseDto.of(List.of(entertainmentDto));
Copy link
Contributor

Choose a reason for hiding this comment

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

아 여기 테스트코드에서는 줄바꿈을 안햇었네요!!
나중에 추가적으로 하는 부분에선 좀 더 신경쓰겠습니다!

fieldWithPath("payload.entertainments[].boundary").type(JsonFieldType.STRING).description("해당 즐길거리의 영역 (내부 or 외부)"),
fieldWithPath("payload.entertainments[].name").type(JsonFieldType.STRING).description("해당 즐길거리의 이름"),
fieldWithPath("payload.entertainments[].explanations[]").type(JsonFieldType.ARRAY).description("해당 즐길거리의 설명 리스트"),
fieldWithPath("payload.entertainments[].tips[]").type(JsonFieldType.ARRAY).description("해당 즐길거리의 팁 리스트")
)
Copy link
Contributor

Choose a reason for hiding this comment

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

.type(JsonFieldType.BOOLEAN) 이거를 통해서 클라이언트측에 타입을 알려줄 수 있는건가요???

Copy link
Member Author

Choose a reason for hiding this comment

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

이거 없어도 타입 자체는 알아서 지정되는 것 같기는 해요!
다만 이제 테스트를 할 때 타입까지 고려해서 좀 더 상세하게 할 수 있다..? 정도인 것 같고
저는 첨부터 썼어가지고 이번 기회로 통일했습니다!

@bbbang105 bbbang105 merged commit 298e83d into develop Nov 8, 2024
1 check passed
@bbbang105 bbbang105 deleted the feature/#59/add-description branch November 8, 2024 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 feat 새로운 기능 추가 / 일부 코드 추가 / 일부 코드 수정 (리팩토링과 구분) / 디자인 요소 수정 🤯 SANGHO 상호 Issue or PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] : 테스트 코드를 수정하여 REST Docs에 설명을 추가한다
2 participants