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
Christian Fischer
October 27, 2020
Technology
870
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
190
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
260
Agile Code Reviews
cfisch3r
1
310
Agile Software Architecture - The missing Manual
cfisch3r
0
270
Other Decks in Technology
See All in Technology
2年前に削除したPHPクラスが、 ある日突然決済をエラーにした
ykagano
1
280
ソニー銀行におけるビジネスアジリティ向上のためのクラウドシフト戦略
srenext
0
730
公式ドキュメントの歩き方etc
coco_se
1
120
DMM.com 購入改善推進チーム におけるCodeRabbitを用いた レビューフロー改善の一例
ysknsid25
2
660
あなたの『Site』はどこですか? — xREという考え方
miyamu
0
1.2k
Making sense of Google’s agentic dev tools
glaforge
1
280
SRE Next 2026 何でも屋からの脱却
bto
0
920
Type-safe IaC for Dart
coborinai
0
160
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
15
110k
カードゲーム作りが教えてくれた プロダクトオーナーシップ
moritamasami
0
110
美しいコードを書くためにF#を学んでみた話
yud0uhu
1
460
OPENLOGI Company Profile for engineer
hr01
1
74k
Featured
See All Featured
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
240
The Pragmatic Product Professional
lauravandoore
37
7.4k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
Prompt Engineering for Job Search
mfonobong
0
380
Utilizing Notion as your number one productivity tool
mfonobong
4
420
Agile that works and the tools we love
rasmusluckow
331
22k
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
Building Applications with DynamoDB
mza
96
7.1k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Abbi's Birthday
coloredviolet
3
8.7k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
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