-
Notifications
You must be signed in to change notification settings - Fork 0
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
Swagger setup #8
Conversation
swagger의 responseDTO에 body 명시해주기 위해 클래스 추가
클래스 구조 및 HttpStatus 사용하는 부분 수정
public ResponseDTO<QuestionDTO> createQuestion(@RequestBody @Valid QuestionDTO.CreateRequest questionDTO) { | ||
return ResponseDTO.<QuestionDTO>builder() | ||
.data(questionDTO.toEntity().toDTO()) | ||
.isSuccess("success") | ||
.message("CREATE SUCCESSFUL") | ||
.message(HttpStatus.CREATED.getReasonPhrase()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다 👍
isSuccess boolean type으로 |
url 복수로 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고 많으셨습니다~~
@Dae-Hwa try it out을 눌러서 나오는 부분이 하나의 입력 공간이 아니라 input box로 설정이 가능할까요? |
@SeonHyungJo 예전 버전 중에 해당 ui가 있긴 한데, 현재는 선택 불가능한 것 같습니다. 대신 커스터마이징에 대한 설명을 찾긴 했는데, 직접 보시는게 더 좋을 것 같아 링크 남겨드리겠습니다. |
기본적인 세팅 완료 했습니다.
https://imd-your-voice.herokuapp.com/swagger-ui.html
30분동안 접속이 없으면 서버가 내려가서 느릴 수 있습니다.
너무 느리면 프로젝트 클론받아 터미널에서
./gredlew bootrun
입력해 실행할 수 있습니다. 직접 실행할 경우 jre11 이상 설치돼있어야 합니다.이전 pr에서 #7 (comment) 이런 의견 있었는데, 스프링에서 HTTP status를 정의해둔 enum 클래스가 있어 활용했습니다.
isSuccess의 값으로 들어가는 success, fail은
![image](https://user-images.githubusercontent.com/24666330/111318094-129f7580-86a8-11eb-8bc2-3cb68060b40d.png)
이런 식으로 정의된 enum을 활용해봐도 괜찮을 것 같은데 의견 부탁드립니다. 2xx, 4xx 같은 공통적인 에러 그룹을 나타내는 enum입니다. 마찬가지로 스프링에서 사용하는 enum 클래스입니다.
혹시나 이상한 부분이나, 추가되었으면 하는 부분 있으면 의견 부탁드립니다. 아마 저보다 여러분들이 더 많이 사용하게 될 것 같은데 필요한 기능 말씀해주시면 설정 가능한지 최대한 찾아보고 답변 드리겠습니다.