Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Orvalやってみた
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
皮しばき
September 21, 2025
Technology
22
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Orvalやってみた
皮しばき
September 21, 2025
Other Decks in Technology
See All in Technology
Gemini Intelligence 入門 ― AppFunctions と Gemini Nano
takuroabe
0
250
『SAR衛星データ解析入門』のご紹介とその応用
syuchimu
0
120
スキマバイトという雇用形態は存在しないので、雇用期間1日のアルバイト契約を事業者とワーカーが結ぶ手続きを支えるのがタイミーなんです
akitoshiga
0
200
ストレスなくAIと付き合いたい!こんなときどうしてる?
namiki64
3
510
エンタメ企業のM&Aを支えるデータ基盤 ― 統合から店舗のリアルタイム分析まで / Data Engineering Summit 2026
genda
0
170
初海外で注意すべきこと12選!!!安全快適なre:invent生活にするために
yuuuuuuu168
1
160
日本語に強いオープンな大規模言語モデル「LLM-jp」
odashi
4
1.1k
スプシの手作業からの解脱 ~更新はClaude Codeに、見せ方と使い方はGASアプリに任せる~
kentarofujii
0
150
無理せず続ける、子育てエンジニアの学び
codmoninc
PRO
0
870
フロントエンドカンファレンス関西2026 - 速すぎるUIに、待ち時間を
teamlab
PRO
0
130
Webの常識が通じないHTMLメールのダークモード
teamlab
PRO
0
120
遠藤な_めぐろLT #38 「社内のAI活用推進」@麻布台_20261009
endonanana
0
130
Featured
See All Featured
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
Visualization
eitanlees
153
17k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
330
Leo the Paperboy
mayatellez
10
2.4k
Ruling the World: When Life Gets Gamed
codingconduct
0
400
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
630
Making Projects Easy
brettharned
120
6.8k
New Earth Scene 8
popppiees
4
2.7k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
630
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
360
RailsConf 2023
tenderlove
30
1.6k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Transcript
Orval やってみた 2025-09-22 『TypeScript のスキーマ駆動開発』実践事例 LT
自己紹介 足立蓮 / 皮しばき / r315dr / moeyashi アイコンは中音ナタ(@natanakane) さん作
趣味:麻雀、コーヒー
Orval って何? OpenAPI の定義から型定義やAPI クライアントコードを自動生成してくれるツール
やってみる npx orval --input ./petstore.yml --output ./src/petstore.ts
できた src/petstore.ts Pet などの型定義 listPets, createPets などのAPI クライアントコード axios が使われている
...OpenAPI-Generator でいいか とはならないところを見ていく
orval.config.(js|mjs|ts)
client: "swr" にしてみる SWR を使ったAPI クライアントコードが生成される。嬉しい React Query も選べる。
mock: true を指定してみる モックデータ生成関数とMSW のハンドラが生成される。嬉しい
client: "zod" にしてみる Zod のスキーマが生成される。嬉しい
これできる?
テストではMSW のdelay(0) にしたい デフォルトは delay(1000) npm run dev と npm
run test で切り替えたい
delayFunctionLazyExecute: true 実行時に評価されるようにする mock: { type: "msw", delay: () =>
(process.env.NODE_ENV === "test" ? 0 : 1000), delayFunctionLazyExecute: true, }, // 生成結果 return http.get('*/pets', async (info) => {await delay((() => process.env.NODE_ENV === "test" ? 0 : 1e3)());
レスポンスをZod で検証したい API クライアントとスキーマは別々で生成される listPets の内部でZod 検証されていると安心
この機能はなさそう GitHub Issue やDiscussion での同様の話はオープンされている スキーマ駆動ならバックエンドからの返り値は信用しよう、という話ではある
おわり
参考 Orval 公式ドキュメント petstore.yml
試した成果物 https://github.com/moeyashi/practice-orval