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

Swagger setup #8

Merged
merged 6 commits into from
Mar 8, 2022
Merged

Swagger setup #8

merged 6 commits into from
Mar 8, 2022

Conversation

Dae-Hwa
Copy link
Collaborator

@Dae-Hwa Dae-Hwa commented Mar 16, 2021

기본적인 세팅 완료 했습니다.
https://imd-your-voice.herokuapp.com/swagger-ui.html
30분동안 접속이 없으면 서버가 내려가서 느릴 수 있습니다.
너무 느리면 프로젝트 클론받아 터미널에서 ./gredlew bootrun 입력해 실행할 수 있습니다. 직접 실행할 경우 jre11 이상 설치돼있어야 합니다.

이전 pr에서 #7 (comment) 이런 의견 있었는데, 스프링에서 HTTP status를 정의해둔 enum 클래스가 있어 활용했습니다.

https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/HttpStatus.html

isSuccess의 값으로 들어가는 success, fail은
image
이런 식으로 정의된 enum을 활용해봐도 괜찮을 것 같은데 의견 부탁드립니다. 2xx, 4xx 같은 공통적인 에러 그룹을 나타내는 enum입니다. 마찬가지로 스프링에서 사용하는 enum 클래스입니다.

혹시나 이상한 부분이나, 추가되었으면 하는 부분 있으면 의견 부탁드립니다. 아마 저보다 여러분들이 더 많이 사용하게 될 것 같은데 필요한 기능 말씀해주시면 설정 가능한지 최대한 찾아보고 답변 드리겠습니다.

@Dae-Hwa Dae-Hwa added the 새로운 기능 새로운 기능 추가했습니다. label Mar 16, 2021
@Dae-Hwa Dae-Hwa self-assigned this Mar 16, 2021
@Dae-Hwa Dae-Hwa linked an issue Mar 16, 2021 that may be closed by this pull request
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())
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

@BKJang BKJang left a comment

Choose a reason for hiding this comment

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

고생하셨습니다 👍

@Dae-Hwa
Copy link
Collaborator Author

Dae-Hwa commented Mar 28, 2021

isSuccess boolean type으로

@Dae-Hwa
Copy link
Collaborator Author

Dae-Hwa commented Mar 28, 2021

url 복수로

Copy link
Collaborator

@dididy dididy left a comment

Choose a reason for hiding this comment

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

수고 많으셨습니다~~

@SeonHyungJo
Copy link
Member

@Dae-Hwa try it out을 눌러서 나오는 부분이 하나의 입력 공간이 아니라 input box로 설정이 가능할까요?

@Dae-Hwa
Copy link
Collaborator Author

Dae-Hwa commented Mar 28, 2021

@Dae-Hwa try it out을 눌러서 나오는 부분이 하나의 입력 공간이 아니라 input box로 설정이 가능할까요?

@SeonHyungJo 예전 버전 중에 해당 ui가 있긴 한데, 현재는 선택 불가능한 것 같습니다.

대신 커스터마이징에 대한 설명을 찾긴 했는데, 직접 보시는게 더 좋을 것 같아 링크 남겨드리겠습니다.
https://github.com/swagger-api/swagger-ui/blob/master/docs/customization/overview.md
https://github.com/swagger-api/swagger-ui/blob/master/docs/customization/custom-layout.md
https://github.com/swagger-api/swagger-ui/tree/master/docs/customization

@Dae-Hwa Dae-Hwa merged commit 10d7e79 into develop Mar 8, 2022
@Dae-Hwa Dae-Hwa deleted the swagger-setup branch March 8, 2022 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
새로운 기능 새로운 기능 추가했습니다.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Swagger 셋팅
4 participants