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
630
Flutter移行の苦労と、乗り越えた先に得られたもの
rtechkouhou
3
11k
ここ数年間のタウンワークiOSアプリのエンジニアのチャレンジ
rtechkouhou
1
1.4k
大規模環境をAWS Transit Gatewayで設計/移行する前に考える3つのポイントと移行への挑戦
rtechkouhou
1
1.9k
【61期 新人BootCamp】TOC入門
rtechkouhou
3
41k
【RTC新人研修 】 TPS
rtechkouhou
1
40k
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
最速最小からはじめるデータプロダクト / Data Product MVP
amaotone
5
740
フルカイテン株式会社 採用資料
fullkaiten
0
36k
なんで、私がAWS Heroに!? 〜社外の広い世界に一歩踏み出そう〜
minorun365
PRO
6
1.1k
現地でMeet Upをやる場合の注意点〜反省点を添えて〜
shotashiratori
0
520
visionOSでの空間表現実装とImmersive Video表示について / ai-immersive-visionos
cyberagentdevelopers
PRO
1
110
バクラクにおける可観測性向上の取り組み
yuu26
3
420
事業者間調整の行間を読む 調整の具体事例
sugiim
0
1.4k
WINTICKETアプリで実現した高可用性と高速リリースを支えるエコシステム / winticket-eco-system
cyberagentdevelopers
PRO
1
190
신뢰할 수 있는 AI 검색 엔진을 만들기 위한 Liner의 여정
huffon
0
340
チームを主語にしてみる / Making "Team" the Subject
ar_tama
4
310
Gradle: The Build System That Loves To Hate You
aurimas
2
150
Nix入門パラダイム編
asa1984
2
200
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
9
680
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
BBQ
matthewcrist
85
9.3k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
228
52k
Speed Design
sergeychernyshev
24
570
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Producing Creativity
orderedlist
PRO
341
39k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Designing Experiences People Love
moore
138
23k
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ఆٛΛܕͰදݱ͠Α͏
͋Γ͕ͱ͏͍͟͝·ͨ͠