Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
agreed-typed
Recruit Technologies
October 12, 2018
Technology
1
3.1k
agreed-typed
2018/10/12 フューチャーアーキテクトとのLTバトルでの、伊藤の講演資料になります
Recruit Technologies
October 12, 2018
Tweet
Share
More Decks by Recruit Technologies
See All by Recruit Technologies
障害はチャンスだ! 障害を前向きに捉える
rtechkouhou
0
320
Flutter移行の苦労と、乗り越えた先に得られたもの
rtechkouhou
3
6.8k
ここ数年間のタウンワークiOSアプリのエンジニアのチャレンジ
rtechkouhou
1
1.2k
大規模環境をAWS Transit Gatewayで設計/移行する前に考える3つのポイントと移行への挑戦
rtechkouhou
1
1.5k
【61期 新人BootCamp】TOC入門
rtechkouhou
2
37k
【RTC新人研修 】 TPS
rtechkouhou
1
36k
Android Boot Camp 2020
rtechkouhou
1
36k
HTML/CSS
rtechkouhou
3
38k
TypeScript Bootcamp 2020
rtechkouhou
8
40k
Other Decks in Technology
See All in Technology
Design for Humans: How to make better modernization decisions
indualagarsamy
2
110
GeoLocationAnchor and MKTileOverlay
toyship
0
110
ラブグラフ紹介資料 〜プロダクト解体新書〜 / Lovegraph Product Deck
lovegraph
0
140
2022年度新卒技術研修「DNS」講義
excitejp
PRO
1
380
アーキテクチャを明文化して開発に臨んだ話
akihiyo76
0
260
1人目QAエンジニアよもやま話 / QA Test Talk Vol.1
nametake
4
220
Implementing Kubernetes operators in Java with Micronaut - TechWeek Java Summit 2022
alvarosanchez
0
110
Power AutomateでのAdaptive Cards-基本編
miyakemito
1
250
JAWS-UG re:Habilitaion 報告 / JAWS-UG OITA rehabilitation
hiranofumio
0
110
モブに早く慣れたい人のためのガイド / A Guide to Getting Started Quickly with Mob Programming
cybozuinsideout
PRO
2
1.7k
SlackBotで あらゆる業務を自動化。問い合わせ〜DevOpsまで #CODT2022
kogatakanori
0
530
1人目QA奮闘記/QA Engineer's Struggle
mii3king
2
1k
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
27
1.5k
Designing the Hi-DPI Web
ddemaree
272
32k
Support Driven Design
roundedbygravity
86
8.5k
Designing Experiences People Love
moore
130
22k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
19
1.4k
No one is an island. Learnings from fostering a developers community.
thoeni
9
1.3k
4 Signs Your Business is Dying
shpigford
169
20k
We Have a Design System, Now What?
morganepeng
35
2.9k
The Pragmatic Product Professional
lauravandoore
19
3k
Fashionably flexible responsive web design (full day workshop)
malarkey
396
62k
jQuery: Nuts, Bolts and Bling
dougneiner
56
6.4k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
315
19k
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ఆٛΛܕͰදݱ͠Α͏
͋Γ͕ͱ͏͍͟͝·ͨ͠