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
Consumer Driven Contracts with OpenAPI
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Christian Fischer
October 27, 2020
Technology
890
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Consumer Driven Contracts with OpenAPI
Christian Fischer
October 27, 2020
More Decks by Christian Fischer
See All by Christian Fischer
The C4 Test Pyramid - An Architecture Driven Test Approach
cfisch3r
2
1.8k
Fix my TDD - Patterns for effective Tests
cfisch3r
1
200
TDD sucks, but that does not have to be.
cfisch3r
1
280
Consumer Driven Contracts in Action
cfisch3r
1
230
Technische Schulden - Ursachen & Lösungsmuster
cfisch3r
0
270
Agile Code Reviews
cfisch3r
1
320
Agile Software Architecture - The missing Manual
cfisch3r
0
290
Other Decks in Technology
See All in Technology
実践! SRE × AI - ABEMA における AIOps -
tetsuya28
7
3k
転んだ話が背中を預ける理由になる / A_story_about_falling_down_gives_you_a_reason_to_watch_each_other_s_backs.pdf
pauli
3
360
ソフトウェア ファクトリー - 再現性のあるソフトウェアの工場づくり / Software factory
iktakahiro
0
280
FOSS4Gを活用した自治体業務DXの試み
470715
0
150
TinyGoでオブザーバビリティ?OpenTelemetryはTinyGoで使えるのか / Is OpenTelemetry available in TinyGo environment?
ymotongpoo
2
140
自主式軟體工廠
philipz
0
260
DGX Spark でどこまでハッキングができるのか?
kash1064
0
1k
自分で立ててみるLLMサービス
y_sera15
0
160
freeeらしさをAIとともに作る / Creating the freee Experience with AI
ymrl
0
230
分析の民主化を支えるメタデータ整備の実践
kakehashi
PRO
4
1.3k
今こそ知りたいAmplifyGen2
mkdev10
2
160
スキマバイトという雇用形態は存在しないので、雇用期間1日のアルバイト契約を事業者とワーカーが結ぶ手続きを支えるのがタイミーなんです
akitoshiga
0
130
Featured
See All Featured
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
58k
Prompt Engineering for Job Search
mfonobong
0
500
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
310
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
540
A designer walks into a library…
pauljervisheath
211
25k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
400
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
560
The agentic SEO stack - context over prompts
schlessera
0
970
Tell your own story through comics
letsgokoyo
1
1.1k
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.1k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
1
280
The Curious Case for Waylosing
cassininazir
1
570
Transcript
Consumer Driven Contracts mit OPENAPI Christian Fischer @agiledojo
Cascading Changes Price Store Marketing Mobile
Consumer Driven Contracts Price Store Marketing Mobile
CDC Frameworks generates generates CDC Service Adapter REST Controller Consumer
Provider Provider Stub Adapter Test REST API Test BL Stub
What do we have to do now? 1. Write Contracts
in provided DSL 2. Switch to generated Mocks for Consumer 3. Integrate Contract Test for Provider Let‘s get started Hmm, isn‘t there an easier ways? We already have an OpenAPI Doc for our REST Service.
OPENAPI 3.0 info servers security paths tags externalDocs conponents OPENAPI
COMPONENTS schemas responses parameters requestBodies headers securitySchemes links callbacks
Swagger Request Validator Service Adapter REST Controller Consumer Provider Provider
Stub Adapter Test REST API Test BL Stub Request Validator Request Validator https://bitbucket.org/atlassian/swagger-request-validator/src/master/
Example: Provider and Consumers Store Backend Price Service Marketing Backend
POST /price [„I“,“II“] status: 200 {„inCent“: 152} POST /price [„I“,“II“] status: 200 {„inCent“: 152, „tax“: 32}
Example: The Contracts Store App Backend Price Service Marketing Portal
store.yml de.agiledojo.cdd:price-api-store marketing.yml de.agiledojo.cdd:price-api-marketing testimplementation testimplementation
Example: The Store Test Fixture Price Service [Wiremock] PriceServiceGatewayAdapter [Adapter
Class] PriceServiceGatewayAdapterIT [Junit Test] setup & start call & assert add OpenApiValidationListener [Wiremock Listener] validate store.yml [OPENAPI Contract]
Example: The Price Service Test Fixture CalculatorMock [Mockito Mock] PriceApiController
[Spring REST Controller Class] PriceApiControllerIT [Spring MockMVC Test] call & assert setup MockMvc [HTTP CLient] OpenApiInteractionValidator [Validator] store.yml [OPENAPI Contract] setup validate
CDC: Pact vs OPENAPI
CDC vs OPENAPI CDC (Pact) OPENAPI Specification Style Consumer First,
Interaction oriented Contract First, Syntax oriented Specification Format API JSON, YAML Languages JVM, JS, NET, Go, Python, Scala, PHP, Ruby, Rust,C++ JVM (Wiremock, RestAssured, MockMVC, Spring Webclient) Contract Broker Pact Server Artifact Repository
JS Pact Validation PriceServiceMock [Pact Mock] Api [Api Adapter Class]
swagger-mock-validator [npm module] create validate api.pact.spec.js [Pact Test] marketing.yml [OPENAPI Contract] call & assert setup Interactions marketing-priceservice.json [PactContract]
Christian Fischer Software Engineering Coach http://agiledojo.de @agiledojo