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

[BUG] openAPI spec type 에러 해결 #165

Merged
merged 5 commits into from
Dec 10, 2024
Merged

Conversation

eonseok-jeon
Copy link
Member

@eonseok-jeon eonseok-jeon commented Nov 30, 2024

✅ PR Point

openapi-typescript를 통해 생성된 interface는 1,000 줄이 넘는 코드로 너무 복잡해서 여기서 따로 type을 추출하기 어려웠어요
따라서 type을 추출하는 아래 라이브러리를 이용해줬습니다
swagger-typescript-api

🏋🏻 실행

yarn api-spec 명령어를 입력하면 자동으로 openapi spec으로 paths와 type들이 추출되도록 해놨습니다. 원래 build 시 마다 하도록 설정했는데 매번 하기엔 불필요한 거 같아서 빼줬어요

🏋🏻 type들 위치

./src/ㅡㅡgeneratedㅡㅡ/org-types/data-contracts.ts에 type들이 추출되어 있어요
나머지 파일들은 각각의 API들끼리 모아놓은 파일입니다
내가 필요한 req data의 type이 뭔지 헷갈린다 하면 해당 API 파일로 가서 참고하시면 좋을 거 같아요

@eonseok-jeon eonseok-jeon self-assigned this Nov 30, 2024
@eonseok-jeon eonseok-jeon linked an issue Nov 30, 2024 that may be closed by this pull request
Copy link

height bot commented Nov 30, 2024

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

Copy link

cloudflare-workers-and-pages bot commented Nov 30, 2024

Deploying sopt-admin with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7257a47
Status: ✅  Deploy successful!
Preview URL: https://9b0b4caa.sopt-admin.pages.dev
Branch Preview URL: https://bug-org-openapi-spec-type.sopt-admin.pages.dev

View logs

Copy link
Member

@lydiacho lydiacho left a comment

Choose a reason for hiding this comment

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

너무 좋네요...
고생 많으셨습니다 😭🚀🚀🚀🚀

Copy link
Member

@wuzoo wuzoo left a comment

Choose a reason for hiding this comment

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

고생하셨습니답 ~~!

@eonseok-jeon eonseok-jeon merged commit 6c3461d into dev Dec 10, 2024
1 check passed
@eonseok-jeon eonseok-jeon deleted the bug-org-openapi-spec-type branch December 18, 2024 00:42
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.

[BUG] openAPI spec type 에러 해결
3 participants