SlideShare a Scribd company logo
Documentation-driven
development for
Python web APIs
• Jose Haro Peralta
• Full stack consultant
• Cofounder of microapis.io
@JoseHaroPeralta
@microapisio
EuroPython 2021
$ whoami
35% discount code: ctweuro21
• I’m Jose
• Independent contractor | London
• Full stack developer
• Microservices and APIs
@JoseHaroPeralta
@microapisio
microapis.io
39% discount code: ctwapi21
One-click API mock servers
@JoseHaroPeralta
@microapisio
Connect with Jose
• Twitter: @JoseHaroPeralta
• GitHub: @abunuwas
• Medium: @joseharoperalta /@python-geek
• LinkedIn: https://www.linkedin.com/in/jose-haro-peralta/
@JoseHaroPeralta
@microapisio
This
presentation
covers
• Complexity of API integrations
• What is documentation-driven development and why
it matters?
• How to you can adopt documentation-driven
development?
• REST API (OpenAPI)
• FastAPI
• Validate server implementation with Dredd and
schemathesis
• Build API clients with mock servers
• Continuous Integration and deployment to Heroku
• API visibitility
• Code for this presentation:
https://github.com/abunuwas/europython-2021
@JoseHaroPeralta
@microapisio
API integrations are tricky
API server
API client
12/12/2020 vs 12-12-2020
Misunderstandings drive API integration
failures
• Misunderstanding about data formats
• "2021-07-29" vs "2021/07/29"
• "$21" vs 21
• true vs "True"
Misunderstandings drive API integration
failures
• Misunderstanding about data types
• "2021" vs 2021
• 202.1 vs 202
Misunderstandings drive API integration
failures
• Misunderstanding about optional fields
vs
Misunderstandings drive API integration
failures
• Misunderstanding about the usability of the endpoints
How API
integrations
fail
Lack of
documentation
Bad documentation
Lack of design stage
What is API documentation?
REST -> OpenAPI
GraphQL -> Schema Definition
Language
gRPC -> Protobuf
What is
documentation-
driven
development?
• Also known as design-first, API-first
or contract-first approach
• Design and produce the API
specification first
• Build your server and your API
client (if you have one) against the
specification
• Use the specification to validate
your implementation
Documentation-driven development for Python web APIs
Dredd / schemathesis
Documentation-driven development for Python web APIs
datamodel-code-generator
(https://github.com/koxudaxi/datamodel-code-generator)
Documentation-driven development for Python web APIs
Run Dredd tests with hooks
Run schemathesis tests with stateful links
Running a mock server with prism
Calling a mock server with prism
Running a mock server with microapis.io
Calling a mock server with microapis.io
Configuration for the Travis file
Thanks for listening!
Twitter: @JoseHaroPeralta
GitHub: @abunuwas
Medium: @joseharoperalta /@python-geek
LinkedIn: https://www.linkedin.com/in/jose-haro-peralta/
35% discount code: ctweuro21

More Related Content

What's hot (20)

Design and Evolution of APIs in Microservice Architecture
Design and Evolution of APIs in Microservice Architecture
Lohika_Odessa_TechTalks
 
Leaping Forward: Finding The Future of Your API Docs
Leaping Forward: Finding The Future of Your API Docs
Pronovix
 
Advancing Your API Strategy in an Infrastructure World
Advancing Your API Strategy in an Infrastructure World
Pronovix
 
API Design Collaboration
API Design Collaboration
Uchit Vyas ☁
 
apidays LIVE Paris 2021 - Using OpenAPI to configure your API Gateway by Ole ...
apidays LIVE Paris 2021 - Using OpenAPI to configure your API Gateway by Ole ...
apidays
 
apidays LIVE New York 2021 - API tool chain for low budget programs by Paul K...
apidays LIVE New York 2021 - API tool chain for low budget programs by Paul K...
apidays
 
Bringing Pull Request to Gerrit
Bringing Pull Request to Gerrit
Eryk Szymanski
 
Chatbots Workshop SF JS Meetup May 2018
Chatbots Workshop SF JS Meetup May 2018
Tessa Mero
 
Introduction to the Art of API Practice
Introduction to the Art of API Practice
Bill Doerrfeld
 
Piwik Presentation
Piwik Presentation
Matthieu Aubry
 
Microservice Stategies - Scaling your API design workflow
Microservice Stategies - Scaling your API design workflow
Jakub Nesetril
 
Tools for designing and building great APIs
Tools for designing and building great APIs
Kong Inc.
 
Writing Slack Bots in JavaScript
Writing Slack Bots in JavaScript
Niklas Heidloff
 
Lessons learned: Choosing your documentation system
Lessons learned: Choosing your documentation system
Pronovix
 
A Starters Guide to Building APIs with Javascript
A Starters Guide to Building APIs with Javascript
All Things Open
 
Logic Apps – Deployments
Logic Apps – Deployments
BizTalk360
 
APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...
APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...
Restlet
 
API SDK Development – Lessons Learned
API SDK Development – Lessons Learned
Pronovix
 
{Re}designing a Developer Portal
{Re}designing a Developer Portal
Pronovix
 
Serverless Architecture
Serverless Architecture
CodePolitan
 
Design and Evolution of APIs in Microservice Architecture
Design and Evolution of APIs in Microservice Architecture
Lohika_Odessa_TechTalks
 
Leaping Forward: Finding The Future of Your API Docs
Leaping Forward: Finding The Future of Your API Docs
Pronovix
 
Advancing Your API Strategy in an Infrastructure World
Advancing Your API Strategy in an Infrastructure World
Pronovix
 
API Design Collaboration
API Design Collaboration
Uchit Vyas ☁
 
apidays LIVE Paris 2021 - Using OpenAPI to configure your API Gateway by Ole ...
apidays LIVE Paris 2021 - Using OpenAPI to configure your API Gateway by Ole ...
apidays
 
apidays LIVE New York 2021 - API tool chain for low budget programs by Paul K...
apidays LIVE New York 2021 - API tool chain for low budget programs by Paul K...
apidays
 
Bringing Pull Request to Gerrit
Bringing Pull Request to Gerrit
Eryk Szymanski
 
Chatbots Workshop SF JS Meetup May 2018
Chatbots Workshop SF JS Meetup May 2018
Tessa Mero
 
Introduction to the Art of API Practice
Introduction to the Art of API Practice
Bill Doerrfeld
 
Microservice Stategies - Scaling your API design workflow
Microservice Stategies - Scaling your API design workflow
Jakub Nesetril
 
Tools for designing and building great APIs
Tools for designing and building great APIs
Kong Inc.
 
Writing Slack Bots in JavaScript
Writing Slack Bots in JavaScript
Niklas Heidloff
 
Lessons learned: Choosing your documentation system
Lessons learned: Choosing your documentation system
Pronovix
 
A Starters Guide to Building APIs with Javascript
A Starters Guide to Building APIs with Javascript
All Things Open
 
Logic Apps – Deployments
Logic Apps – Deployments
BizTalk360
 
APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...
APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...
Restlet
 
API SDK Development – Lessons Learned
API SDK Development – Lessons Learned
Pronovix
 
{Re}designing a Developer Portal
{Re}designing a Developer Portal
Pronovix
 
Serverless Architecture
Serverless Architecture
CodePolitan
 

Similar to Documentation-driven development for Python web APIs (20)

APIs with Bounded Contexts: Modelling Apis with Domain-Driven Design
APIs with Bounded Contexts: Modelling Apis with Domain-Driven Design
José Haro Peralta
 
APIs with Bounded Contexts: Modeling APIs with Domain-Driven Design
APIs with Bounded Contexts: Modeling APIs with Domain-Driven Design
Nordic APIs
 
INTERFACE by apidays 2023 - APIs with bounded contexts, Jose Haro Peralta, mi...
INTERFACE by apidays 2023 - APIs with bounded contexts, Jose Haro Peralta, mi...
apidays
 
AtlasCamp 2014: Hipchat Add-ons for the Atlassian Marketplace
AtlasCamp 2014: Hipchat Add-ons for the Atlassian Marketplace
Atlassian
 
AOC hacktoberfest meetup 2024. An open-source event
AOC hacktoberfest meetup 2024. An open-source event
autumnofcodeindia
 
Revolutionize Your Workflow with ChatOps
Revolutionize Your Workflow with ChatOps
Tessa Mero
 
Automating web application security testing using Hubot AI / NLP chat bot - B...
Automating web application security testing using Hubot AI / NLP chat bot - B...
Abhijith B R
 
Combining Healthcare Standards with Other RESTful APIs
Combining Healthcare Standards with Other RESTful APIs
Brad Genereaux
 
API Trends & Use Cases
API Trends & Use Cases
SmartWave
 
Piwik Analytics Platform
Piwik Analytics Platform
piwik
 
December OpenNTF Webinar: The Volt MX LotusScript Toolkit
December OpenNTF Webinar: The Volt MX LotusScript Toolkit
Howard Greenberg
 
CyberArkUIPath_RPA Final (1).pptx
CyberArkUIPath_RPA Final (1).pptx
RohitRadhakrishnan8
 
CyberArkUIPath_RPA Final (2).pptx
CyberArkUIPath_RPA Final (2).pptx
RohitRadhakrishnan8
 
CyberArkUIPath_RPA Final (2).pptx
CyberArkUIPath_RPA Final (2).pptx
RohitRadhakrishnan8
 
Building Better Software Faster
Building Better Software Faster
Sander Hoogendoorn
 
Case Study: A Real-World Implementation Of Linked Data
Case Study: A Real-World Implementation Of Linked Data
ProgrammableWeb
 
Platforms FTW!
Platforms FTW!
Matt O'Keefe
 
Platforms FTW!
Platforms FTW!
Matt O'Keefe
 
SPSHK.PowerBI.SharePoint.NhutNguyen
SPSHK.PowerBI.SharePoint.NhutNguyen
Terrence Nguyen
 
Octo API-days 2015
Octo API-days 2015
Antoine CHANTALOU
 
APIs with Bounded Contexts: Modelling Apis with Domain-Driven Design
APIs with Bounded Contexts: Modelling Apis with Domain-Driven Design
José Haro Peralta
 
APIs with Bounded Contexts: Modeling APIs with Domain-Driven Design
APIs with Bounded Contexts: Modeling APIs with Domain-Driven Design
Nordic APIs
 
INTERFACE by apidays 2023 - APIs with bounded contexts, Jose Haro Peralta, mi...
INTERFACE by apidays 2023 - APIs with bounded contexts, Jose Haro Peralta, mi...
apidays
 
AtlasCamp 2014: Hipchat Add-ons for the Atlassian Marketplace
AtlasCamp 2014: Hipchat Add-ons for the Atlassian Marketplace
Atlassian
 
AOC hacktoberfest meetup 2024. An open-source event
AOC hacktoberfest meetup 2024. An open-source event
autumnofcodeindia
 
Revolutionize Your Workflow with ChatOps
Revolutionize Your Workflow with ChatOps
Tessa Mero
 
Automating web application security testing using Hubot AI / NLP chat bot - B...
Automating web application security testing using Hubot AI / NLP chat bot - B...
Abhijith B R
 
Combining Healthcare Standards with Other RESTful APIs
Combining Healthcare Standards with Other RESTful APIs
Brad Genereaux
 
API Trends & Use Cases
API Trends & Use Cases
SmartWave
 
Piwik Analytics Platform
Piwik Analytics Platform
piwik
 
December OpenNTF Webinar: The Volt MX LotusScript Toolkit
December OpenNTF Webinar: The Volt MX LotusScript Toolkit
Howard Greenberg
 
CyberArkUIPath_RPA Final (1).pptx
CyberArkUIPath_RPA Final (1).pptx
RohitRadhakrishnan8
 
CyberArkUIPath_RPA Final (2).pptx
CyberArkUIPath_RPA Final (2).pptx
RohitRadhakrishnan8
 
CyberArkUIPath_RPA Final (2).pptx
CyberArkUIPath_RPA Final (2).pptx
RohitRadhakrishnan8
 
Case Study: A Real-World Implementation Of Linked Data
Case Study: A Real-World Implementation Of Linked Data
ProgrammableWeb
 
SPSHK.PowerBI.SharePoint.NhutNguyen
SPSHK.PowerBI.SharePoint.NhutNguyen
Terrence Nguyen
 
Ad

Recently uploaded (20)

Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Puppy jhon
 
How the US Navy Approaches DevSecOps with Raise 2.0
How the US Navy Approaches DevSecOps with Raise 2.0
Anchore
 
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
soulamaabdoulaye128
 
UPDASP a project coordination unit ......
UPDASP a project coordination unit ......
withrj1
 
Agile Software Engineering Methodologies
Agile Software Engineering Methodologies
Gaurav Sharma
 
Zoneranker’s Digital marketing solutions
Zoneranker’s Digital marketing solutions
reenashriee
 
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
alexandernoetzold
 
GDG Douglas - Google AI Agents: Your Next Intern?
GDG Douglas - Google AI Agents: Your Next Intern?
felipeceotto
 
Step by step guide to install Flutter and Dart
Step by step guide to install Flutter and Dart
S Pranav (Deepu)
 
Generative Artificial Intelligence and its Applications
Generative Artificial Intelligence and its Applications
SandeepKS52
 
Migrating to Azure Cosmos DB the Right Way
Migrating to Azure Cosmos DB the Right Way
Alexander (Alex) Komyagin
 
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
BradBedford3
 
Plooma is a writing platform to plan, write, and shape books your way
Plooma is a writing platform to plan, write, and shape books your way
Plooma
 
Making significant Software Architecture decisions
Making significant Software Architecture decisions
Bert Jan Schrijver
 
AI-Powered Compliance Solutions for Global Regulations | Certivo
AI-Powered Compliance Solutions for Global Regulations | Certivo
certivoai
 
Software Testing & it’s types (DevOps)
Software Testing & it’s types (DevOps)
S Pranav (Deepu)
 
Transmission Media. (Computer Networks)
Transmission Media. (Computer Networks)
S Pranav (Deepu)
 
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
Aarno Aukia
 
Code and No-Code Journeys: The Coverage Overlook
Code and No-Code Journeys: The Coverage Overlook
Applitools
 
Open Source Software Development Methods
Open Source Software Development Methods
VICTOR MAESTRE RAMIREZ
 
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Puppy jhon
 
How the US Navy Approaches DevSecOps with Raise 2.0
How the US Navy Approaches DevSecOps with Raise 2.0
Anchore
 
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
soulamaabdoulaye128
 
UPDASP a project coordination unit ......
UPDASP a project coordination unit ......
withrj1
 
Agile Software Engineering Methodologies
Agile Software Engineering Methodologies
Gaurav Sharma
 
Zoneranker’s Digital marketing solutions
Zoneranker’s Digital marketing solutions
reenashriee
 
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
alexandernoetzold
 
GDG Douglas - Google AI Agents: Your Next Intern?
GDG Douglas - Google AI Agents: Your Next Intern?
felipeceotto
 
Step by step guide to install Flutter and Dart
Step by step guide to install Flutter and Dart
S Pranav (Deepu)
 
Generative Artificial Intelligence and its Applications
Generative Artificial Intelligence and its Applications
SandeepKS52
 
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
BradBedford3
 
Plooma is a writing platform to plan, write, and shape books your way
Plooma is a writing platform to plan, write, and shape books your way
Plooma
 
Making significant Software Architecture decisions
Making significant Software Architecture decisions
Bert Jan Schrijver
 
AI-Powered Compliance Solutions for Global Regulations | Certivo
AI-Powered Compliance Solutions for Global Regulations | Certivo
certivoai
 
Software Testing & it’s types (DevOps)
Software Testing & it’s types (DevOps)
S Pranav (Deepu)
 
Transmission Media. (Computer Networks)
Transmission Media. (Computer Networks)
S Pranav (Deepu)
 
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
Aarno Aukia
 
Code and No-Code Journeys: The Coverage Overlook
Code and No-Code Journeys: The Coverage Overlook
Applitools
 
Open Source Software Development Methods
Open Source Software Development Methods
VICTOR MAESTRE RAMIREZ
 
Ad

Documentation-driven development for Python web APIs