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
4.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
1
700
Flutter移行の苦労と、乗り越えた先に得られたもの
rtechkouhou
3
12k
ここ数年間のタウンワークiOSアプリのエンジニアのチャレンジ
rtechkouhou
1
1.5k
大規模環境をAWS Transit Gatewayで設計/移行する前に考える3つのポイントと移行への挑戦
rtechkouhou
1
1.9k
【61期 新人BootCamp】TOC入門
rtechkouhou
3
42k
【RTC新人研修 】 TPS
rtechkouhou
1
41k
Android Boot Camp 2020
rtechkouhou
0
41k
HTML/CSS
rtechkouhou
10
51k
TypeScript Bootcamp 2020
rtechkouhou
9
46k
Other Decks in Technology
See All in Technology
Lufthansa ®️ USA Contact Numbers: Complete 2025 Support Guide
lufthanahelpsupport
0
220
VGGT: Visual Geometry Grounded Transformer
peisuke
1
240
SEQUENCE object comparison - db tech showcase 2025 LT2
nori_shinoda
0
200
american airlines®️ USA Contact Numbers: Complete 2025 Support Guide
supportflight
1
110
Rethinking Incident Response: Context-Aware AI in Practice
rrreeeyyy
1
130
開発生産性を測る前にやるべきこと - 組織改善の実践 / Before Measuring Dev Productivity
kaonavi
14
6.5k
改めてAWS WAFを振り返る~業務で使うためのポイント~
masakiokuda
2
300
衛星運用をソフトウェアエンジニアに依頼したときにできあがるもの
sankichi92
1
170
Coinbase™®️ USA Contact Numbers: Complete 2025 Support Guide
officialcoinbasehelpcenter
0
460
敢えて生成AIを使わないマネジメント業務
kzkmaeda
2
470
ABEMAの本番環境負荷試験への挑戦
mk2taiga
5
330
OSSのSNSツール「Misskey」をさわってみよう(右下ワイプで私のOSCの20年を振り返ります) / 20250705-osc2025-do
akkiesoft
0
170
Featured
See All Featured
Building Applications with DynamoDB
mza
95
6.5k
Code Review Best Practice
trishagee
69
19k
Navigating Team Friction
lara
187
15k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.5k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
20
1.3k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
Visualization
eitanlees
146
16k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
740
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
700
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
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ఆٛΛܕͰදݱ͠Α͏
͋Γ͕ͱ͏͍͟͝·ͨ͠