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

BackendとFrontendで型を共有したい #361

Open
bvv-1 opened this issue Jun 5, 2024 · 2 comments
Open

BackendとFrontendで型を共有したい #361

bvv-1 opened this issue Jun 5, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@bvv-1
Copy link
Contributor

bvv-1 commented Jun 5, 2024

課題

  • ほぼ同一の型定義をフロントエンドとバックエンドに置いているので、片方を変更した場合にもう片方に変更を反映させ忘れることがある
    (- フロントエンドとバックエンドで同じ言語を使ってmonorepoで管理しているのに、その利点をあまり活かせていない)

解決策

@bvv-1 bvv-1 added the enhancement New feature or request label Jun 5, 2024
@bvv-1 bvv-1 changed the title BackendとFrontendでPrismaの型を共有したい BackendとFrontendで型を共有したい Jun 5, 2024
@bvv-1
Copy link
Contributor Author

bvv-1 commented Jun 5, 2024

バックエンドの型(Prisma)をフロントエンドで呼び出す

PrismaはDBの型なので、APIの型はOpenAPIのschemaで定義したほうがよさそう
https://tech.smarthr.jp/entry/2020/08/25/135631

bvv-1 added a commit that referenced this issue Jun 12, 2024
bvv-1 added a commit that referenced this issue Jun 12, 2024
ユーザーネーム関連をフロントエンドから消し去った
@bvv-1
Copy link
Contributor Author

bvv-1 commented Aug 4, 2024

bvv-1 added a commit that referenced this issue Aug 4, 2024
…api-typescript

Add response types with openapi-typescript 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant