-
Notifications
You must be signed in to change notification settings - Fork 2
[#60] ✨ 스웨거 업데이트에 따른 타입 추가 #140
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
Conversation
yellowjang
left a comment
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.
타입에 대한 빠른 업뎃 감사합니다! 고생하셨습니다 :)
| parameters: { | ||
| query?: never | ||
| header?: never | ||
| path?: never | ||
| cookie?: never | ||
| } | ||
| get?: never | ||
| put?: never | ||
| /** 닉네임 중복 체크 */ | ||
| post: operations['checkNicknameDuplicate'] | ||
| delete?: never | ||
| options?: never | ||
| head?: never | ||
| patch?: never | ||
| trace?: never | ||
| } |
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.
'never' 타입을 적용하는 건 처음 보네요! 찾아보니
의 용도로 사용한다고 하는군요.. 덕분에 never 타입에 대해 알아갑니다!
그러면 타입 스크립트에서 타입 지정이 필요없을 때 ? 사용하는 것 같은데,
정확히 어떤 목적으로 사용되는 건지 알려주실 수 있나요 ??
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.
ApiSchema.types.d.ts 파일 같은 경우 제가 openapi-typescript 라는 도구를 사용하여 민지님이 작업해주신 스펙에 있는 타입을 그대로 타입스크립트 파일로 생성한 결과물입니다 !
my-page-check-nickname 엔드포인트에서는 post 메서드만 있고 나머지의 경우는 없고, 다른 요구하는 쿼리 등이 없어서 never 로 타입이 변환된 듯 하네요.
http://43.202.50.174:8080/v3/api-docs 실제 스펙에서는 never 로 지정되어 있지 않지만, 특정 엔드포인트에서 존재하지 않는 요청에 대해서 타입스크립트로 변환할 때 never 타입으로 자동 생성된 듯 합니다 !
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.
아 ㅎㅎ 민지님께서 작업해주신 것을 바탕으로 타입을 생성해주셔서 그런 거군요! 감사합니다 ~
| // 포트폴리오 리스트 조회 | ||
| export interface PortfolioDetail extends PortfolioBase { | ||
| portContent: string // 상세 내용 | ||
| techStacks: TechStack[] // 사용 기술 스택 | ||
| links?: PortfolioLink[] // 외부 링크 |
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.
전부터 느꼈지만, 여러 번 재사용되는 타입을 기본 base 타입을 지정해두고, extends 하니 여러번 정의해줘야하는 번거로움을 피할 수 있어서 정말 좋네요
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.
네 맞아요 !
📌 PR 템플릿
🏷️ PR 타입 (PR Type)
📝 요약 (Summary)
백엔드 작업 상황에 따라 api 관련 타입들의 업데이트 작업
🔍 상세 내용 (Describe your changes)
🔗 관련 이슈 또는 링크 (Issue Number or Link)
✅ 체크리스트 (Checklist)
📸 스크린샷 (선택 사항)
빌드 성공
📝 기타 사항