Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
agreed-typed
Search
Recruit Technologies
October 12, 2018
Technology
1
3.9k
agreed-typed
2018/10/12 フューチャーアーキテクトとのLTバトルでの、伊藤の講演資料になります
Recruit Technologies
October 12, 2018
Tweet
Share
More Decks by Recruit Technologies
See All by Recruit Technologies
障害はチャンスだ! 障害を前向きに捉える
rtechkouhou
1
640
Flutter移行の苦労と、乗り越えた先に得られたもの
rtechkouhou
3
11k
ここ数年間のタウンワークiOSアプリのエンジニアのチャレンジ
rtechkouhou
1
1.5k
大規模環境をAWS Transit Gatewayで設計/移行する前に考える3つのポイントと移行への挑戦
rtechkouhou
1
1.9k
【61期 新人BootCamp】TOC入門
rtechkouhou
3
41k
【RTC新人研修 】 TPS
rtechkouhou
1
41k
Android Boot Camp 2020
rtechkouhou
0
41k
HTML/CSS
rtechkouhou
10
50k
TypeScript Bootcamp 2020
rtechkouhou
9
45k
Other Decks in Technology
See All in Technology
AGIについてChatGPTに聞いてみた
blueb
0
130
FlutterアプリにおけるSLI/SLOを用いたユーザー体験の可視化と計測基盤構築
ostk0069
0
100
インフラとバックエンドとフロントエンドをくまなく調べて遅いアプリを早くした件
tubone24
1
430
Platform Engineering for Software Developers and Architects
syntasso
1
520
OTelCol_TailSampling_and_SpanMetrics
gumamon
1
200
CDCL による厳密解法を採用した MILP ソルバー
imai448
3
140
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
950
TypeScript、上達の瞬間
sadnessojisan
46
13k
Lambdaと地方とコミュニティ
miu_crescent
2
370
Engineer Career Talk
lycorp_recruit_jp
0
190
日経電子版のStoreKit2フルリニューアル
shimastripe
1
140
Making your applications cross-environment - OSCG 2024 NA
salaboy
0
190
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
Done Done
chrislema
181
16k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
Designing Experiences People Love
moore
138
23k
How GitHub (no longer) Works
holman
310
140k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Practical Orchestrator
shlominoach
186
10k
What's new in Ruby 2.0
geeforr
343
31k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Transcript
agreed-typed ҏ౻ɹӯ
ࣗݾհ • ҏ౻ɹӯʢ͍ͱ͏ɹ͖͋ͱʣ • @akito0107 • 2015 ϦΫϧʔτೖࣾ • ιϑτΣΞΤϯδχΞ
• Go / Node.jsΛॻ͍͍ͯ·͢
ͳ͢͜ͱ • RTCͷΑ͋͘ΔΞʔΩςΫνϟ • AgreedͱConsumer-Driven Contract • Agreed-Typed • ·ͱΊ
from: https://speakerdeck.com/yosuke_furukawa/rikurutotekufalserozizufalseji-shu-dong-xiang?slide=11
None
None
͜͜
͍ͭ ͜͜Ͱ ݂͕ྲྀ ΕΔ
APIͷI/Fʹؔ͢Δ • ୭͕͍ܾͭΊΔ • Backend͕উखʹܾΊͯFront͔Β͍ͮΒ͍ (ex, N + 1 http
requestͳͲ) • ϝϯςφϯεਏ͍ • DocumentͱͷෆҰகɺͦͦDocͳͲͳ͍ɺ etc…
Agreed • https://github.com/recruit-tech/agreed • Consumer-Driven Contract&Specification By Exampleͷπʔϧ • APIΛ͏ଆʢFEʣ͕request
/ responseΛJSONͳͲͰ ࣗ༝ʹࢦఆͰ͖Δ • FEͷͨΊʹMock Serverͱͯ͠ৼΔ͏ • BEͷͨΊʹE2E testing toolsͱͯ͠ৼΔ͏
Agreed Sample • agreed.js
Agreed Server Sample • Run Server • curl
Agreed fileͷදݱྗͷ • AgreedFE͕खܰʹmock serverΛཱͯΔͨΊͷΈ • Agreed fileΛਖ਼͘͠ॻ͘͜ͱࣗମ͕͍͠ • ex)
ඞਢɾඇඞਢΛදݱͰ͖ͳ͍, ύϥϝʔλͷൈ͚͕ ݕͰ͖ͳ͍ͳͲ • agreedͰrequest / responseΛఆٛͯ͠ɺFE/BEͰਖ਼ ͘͠ॲཧͰ͖ͯΔ͔Λ֬ೝ͢Δํ๏͕ͳ͍
agreed-typed • Agreed fileͷAPIఆٛʹܕΛ͚ͭΔͨΊͷϥΠϒ ϥϦ • APIΛܕͰදݱ • requestͷPathܕ, responseͷstatusCodeܕ
• agreedͷఆٛΛ੩తղੳ͢Δ
agreed-typed sample 1 • APIDef<>͔ΒͷܕΤΠϦΞεͰAPIΛఆٛ
agreed-typed sample 2 • ܕʹैͬͯexampleΛఆٛ
agreed-typed sample 3 • Run Server • curl
agreed-typed sample 4 • ͍Ζ͍ΖͳܕνΣοΫΛ͔͚ΒΕΔ ະఆٛͷCPEZ ఆ͞Εͳ͍ TUBUVTDPEF QBUI͕ؒҧͬͯΔ
ଞʹίϯύΠϥ͕νΣοΫͰ ͖Δ͜ͱ • GETʹbody͚ͭΔͱίϯύΠϥౖ͕Δ • Status codeʹΑΓbodyग़͚͠ • etc…
Future of API design • Specification by example or
Specification by design • Consumer / Producerͷඇରশੑ • ܕͰAPIΛදݱ͠ɺਖ਼ੑΛίϯύΠϥ͕ݕূ͢Δ ੈք͕དྷΔ • Haskell servant / Protobuf
·ͱΊ • agreedͱconsumer driven contractͷհ • agreed-typedͷհ • APIఆٛΛܕͰදݱ͠Α͏
͋Γ͕ͱ͏͍͟͝·ͨ͠