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
Consumer Driven Contracts with OpenAPI
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Christian Fischer
October 27, 2020
Technology
860
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
180
TDD sucks, but that does not have to be.
cfisch3r
1
270
Consumer Driven Contracts in Action
cfisch3r
1
220
Technische Schulden - Ursachen & Lösungsmuster
cfisch3r
0
250
Agile Code Reviews
cfisch3r
1
310
Agile Software Architecture - The missing Manual
cfisch3r
0
270
Other Decks in Technology
See All in Technology
Kiro Ambassador を目指す話
k_adachi_01
0
110
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
3k
いまさら聞けない「仕様駆動開発入門」 〜AI活用時代の開発プロセスを考える〜
findy_eventslides
2
170
Comment regagner la souveraineté de vos données tout en étant payé grâce à Nostr !
rlifchitz
0
110
GitHub Copilot 最新アップデート – 「一歩先」の実践活用術
moulongzhang
5
1.6k
就職⽀援サービスにおけるキャリアアドバイザーのシフトスケジューリング
recruitengineers
PRO
1
150
FPC(フレキシブル)基板にZephyr実装してみた。
iotengineer22
0
140
Bucharest Tech Week 2026 - Reinventing testing practices in the AI era
edeandrea
PRO
1
170
LayerXにおけるセキュリティ管理の現在地と次の一手
tosho
0
260
Bucharest Tech Week 2026 - Guardians of the Cloud-Native Galaxy
edeandrea
PRO
0
130
自宅LLMの話
jacopen
1
690
Claude Codeをどのように キャッチアップしているか
oikon48
13
8.7k
Featured
See All Featured
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
140
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
610
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
230
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
Ruling the World: When Life Gets Gamed
codingconduct
0
260
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
740
Java REST API Framework Comparison - PWX 2021
mraible
34
9.4k
Producing Creativity
orderedlist
PRO
348
40k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
55k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
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