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
@JoseHaroPeralta
@microapisio
Repository for this presentation:
https://github.com/abunuwas/europython-2021
API integrations are tricky
API server
API client
Major causes of API
integration failures
• Backend-driven API development
• Lack of separation between API layer and the rest of the
app
• Misunderstandings about the API
• Lack of validation
Fundamental
law of API
integrations
No API survives first contact
with its client
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 v2
Dredd / schemathesis
Documentation-driven development for Python web APIs v2
datamodel-code-generator
(https://github.com/koxudaxi/datamodel-code-generator)
Documentation-driven development for Python web APIs v2
• GitHub: https://github.com/apiaryio/dredd
Generate tests with Dredd
Run Dredd tests with hooks
Running tests with Dredd
Validating the API server implementation with schemathesis
• GitHub: https://github.com/schemathesis/schemathesis
Run schemathesis tests with stateful links
Run schemathesis tests with stateful links
Building API clients against mock servers
We use a mock API server to build the client
Run a local server with Prism
• Stoplight’s Prism library
• GitHub: https://github.com/stoplightio/prism
Running a mock server with prism
Documentation-driven development for Python web APIs v2
Running a mock server in the cloud
• Stoplight
• Postman
• MockLab
• microapis.io
Running a mock server in the cloud
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
Links
• Microservice APIs in Python by J Haro (mng.bz/nz48)
• Building and deploying reliable APIs with FastAPI by J Haro
(https://www.twitch.tv/videos/1088283640)
• Documentation-driven development for APIs by J Haro
(https://link.medium.com/m2A3rOxUfib)
• Developing API clients doesn’t need to be a pain by J Haro
(https://link.medium.com/0B9vt7DUfib)
• Design patterns for modern web APIs by D Luecke
(https://blog.feathersjs.com/design-patterns-for-modern-web-apis-1f046635215)
• The design of web APIs by A Lauret (https://www.manning.com/books/the-
design-of-web-apis)
• API Design Patterns by JJ Geewax (https://www.manning.com/books/api-design-
patterns)

More Related Content

PPTX
Delivering successful API integrations with documentation-driven development
PPTX
Documentation-driven development for Python web APIs
PPTX
PyBCN 2020
PPTX
API Conference 2021
PDF
APIdays Singapore 2019 - Bringing OpenAPI to devOps, Vincenzo Chianese, Softw...
PPTX
Pure APIs: Development workflows for successful API integrations
PPTX
Blood, sweat, and creating an API handbook
PDF
apidays LIVE New York 2021 - API tool chain for low budget programs by Paul K...
Delivering successful API integrations with documentation-driven development
Documentation-driven development for Python web APIs
PyBCN 2020
API Conference 2021
APIdays Singapore 2019 - Bringing OpenAPI to devOps, Vincenzo Chianese, Softw...
Pure APIs: Development workflows for successful API integrations
Blood, sweat, and creating an API handbook
apidays LIVE New York 2021 - API tool chain for low budget programs by Paul K...

What's hot (20)

PPTX
API First Workflow: How could we have better API Docs through DevOps pipeline
PDF
apidays LIVE Paris 2021 - Using OpenAPI to configure your API Gateway by Ole ...
PPTX
Bringing Pull Request to Gerrit
PDF
Advancing Your API Strategy in an Infrastructure World
PDF
Leaping Forward: Finding The Future of Your API Docs
PPTX
Design and Evolution of APIs in Microservice Architecture
PPTX
Writing Slack Bots in JavaScript
PDF
Lessons learned: Choosing your documentation system
PDF
API Design Collaboration
PPTX
APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...
PPTX
Tools and techniques for APIs
PDF
apidays LIVE Hong Kong 2021 - Better API DX with a CLI by Phil Nash, Twilio
PPTX
Scaling API Design
PPTX
Scaling API Design - Nordic APIs 2014
PDF
What Postman Did for a CEO Who Can’t Code by Craig Balkin
PDF
Intuitive APIs and Developer Education
PDF
Creating Interactive Docs with Postman
PPT
apidays LIVE New York 2021 - Designing API's: Less Data is More! by Damir Svr...
PDF
14 API Directories
PPTX
.NET MAUI with .NET 6 (December 2021, Preview 10)
API First Workflow: How could we have better API Docs through DevOps pipeline
apidays LIVE Paris 2021 - Using OpenAPI to configure your API Gateway by Ole ...
Bringing Pull Request to Gerrit
Advancing Your API Strategy in an Infrastructure World
Leaping Forward: Finding The Future of Your API Docs
Design and Evolution of APIs in Microservice Architecture
Writing Slack Bots in JavaScript
Lessons learned: Choosing your documentation system
API Design Collaboration
APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...
Tools and techniques for APIs
apidays LIVE Hong Kong 2021 - Better API DX with a CLI by Phil Nash, Twilio
Scaling API Design
Scaling API Design - Nordic APIs 2014
What Postman Did for a CEO Who Can’t Code by Craig Balkin
Intuitive APIs and Developer Education
Creating Interactive Docs with Postman
apidays LIVE New York 2021 - Designing API's: Less Data is More! by Damir Svr...
14 API Directories
.NET MAUI with .NET 6 (December 2021, Preview 10)
Ad

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

PPTX
APIs with Bounded Contexts: Modelling Apis with Domain-Driven Design
PPTX
Integrating Alfresco with Portals
PDF
Developing Brilliant and Powerful APIs in Ruby & Python
PPTX
Practical Application of API-First in microservices development
PDF
Developing applications with Hyperledger Fabric SDK
PDF
CodeStarではじめるRailsアプリのCodeDeploy化
PDF
AtlasCamp 2014: Hipchat Add-ons for the Atlassian Marketplace
PDF
Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023
PPTX
Hybrid integration with self hosted azure api gateways - published v1.0
PDF
Progressive Enhancement using WSGI
PPTX
ChatOps Workshop
PDF
Serverless Summit 22 - micro-frontends aws archiecture
PPTX
API Gateways are going through an identity crisis
PPTX
Azure API Management
PDF
Platforms FTW!
PDF
Platforms FTW!
PPTX
Get Start With GitHub_Copilot_for_Developers.pptx
PPTX
Building a REST API Microservice for the DevNet API Scavenger Hunt
PPTX
API Documentation Workshop tcworld India 2015
PDF
Architecture Battle: PaaS vs. FaaS
APIs with Bounded Contexts: Modelling Apis with Domain-Driven Design
Integrating Alfresco with Portals
Developing Brilliant and Powerful APIs in Ruby & Python
Practical Application of API-First in microservices development
Developing applications with Hyperledger Fabric SDK
CodeStarではじめるRailsアプリのCodeDeploy化
AtlasCamp 2014: Hipchat Add-ons for the Atlassian Marketplace
Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023
Hybrid integration with self hosted azure api gateways - published v1.0
Progressive Enhancement using WSGI
ChatOps Workshop
Serverless Summit 22 - micro-frontends aws archiecture
API Gateways are going through an identity crisis
Azure API Management
Platforms FTW!
Platforms FTW!
Get Start With GitHub_Copilot_for_Developers.pptx
Building a REST API Microservice for the DevNet API Scavenger Hunt
API Documentation Workshop tcworld India 2015
Architecture Battle: PaaS vs. FaaS
Ad

Recently uploaded (20)

PDF
Understanding Forklifts - TECH EHS Solution
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PPTX
Essential Infomation Tech presentation.pptx
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
System and Network Administraation Chapter 3
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Digital Strategies for Manufacturing Companies
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Understanding Forklifts - TECH EHS Solution
wealthsignaloriginal-com-DS-text-... (1).pdf
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Essential Infomation Tech presentation.pptx
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
How to Choose the Right IT Partner for Your Business in Malaysia
Softaken Excel to vCard Converter Software.pdf
Odoo Companies in India – Driving Business Transformation.pdf
System and Network Administraation Chapter 3
Odoo POS Development Services by CandidRoot Solutions
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Upgrade and Innovation Strategies for SAP ERP Customers
Digital Strategies for Manufacturing Companies
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Operating system designcfffgfgggggggvggggggggg
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
2025 Textile ERP Trends: SAP, Odoo & Oracle
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)

Documentation-driven development for Python web APIs v2

  • 1. Documentation-driven development for Python web APIs • Jose Haro Peralta • Full stack consultant • Cofounder of microapis.io @JoseHaroPeralta @microapisio EuroPython 2021
  • 2. $ whoami 35% discount code: ctweuro21 • I’m Jose • Independent contractor | London • Full stack developer • Microservices and APIs @JoseHaroPeralta @microapisio
  • 3. microapis.io 39% discount code: ctwapi21 One-click API mock servers @JoseHaroPeralta @microapisio
  • 4. Connect with Jose • Twitter: @JoseHaroPeralta • GitHub: @abunuwas • Medium: @joseharoperalta /@python-geek • LinkedIn: https://www.linkedin.com/in/jose-haro-peralta/ @JoseHaroPeralta @microapisio
  • 5. 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 @JoseHaroPeralta @microapisio Repository for this presentation: https://github.com/abunuwas/europython-2021
  • 6. API integrations are tricky API server API client
  • 7. Major causes of API integration failures • Backend-driven API development • Lack of separation between API layer and the rest of the app • Misunderstandings about the API • Lack of validation
  • 8. Fundamental law of API integrations No API survives first contact with its client
  • 9. What is API documentation? REST -> OpenAPI GraphQL -> Schema Definition Language gRPC -> Protobuf
  • 10. 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
  • 17. Run Dredd tests with hooks
  • 19. Validating the API server implementation with schemathesis • GitHub: https://github.com/schemathesis/schemathesis
  • 20. Run schemathesis tests with stateful links
  • 21. Run schemathesis tests with stateful links
  • 22. Building API clients against mock servers We use a mock API server to build the client
  • 23. Run a local server with Prism • Stoplight’s Prism library • GitHub: https://github.com/stoplightio/prism
  • 24. Running a mock server with prism
  • 26. Running a mock server in the cloud • Stoplight • Postman • MockLab • microapis.io
  • 27. Running a mock server in the cloud
  • 28. Running a mock server with microapis.io
  • 29. Calling a mock server with microapis.io
  • 30. Configuration for the Travis file
  • 31. Thanks for listening! Twitter: @JoseHaroPeralta GitHub: @abunuwas Medium: @joseharoperalta /@python-geek LinkedIn: https://www.linkedin.com/in/jose-haro-peralta/ 35% discount code: ctweuro21
  • 32. Links • Microservice APIs in Python by J Haro (mng.bz/nz48) • Building and deploying reliable APIs with FastAPI by J Haro (https://www.twitch.tv/videos/1088283640) • Documentation-driven development for APIs by J Haro (https://link.medium.com/m2A3rOxUfib) • Developing API clients doesn’t need to be a pain by J Haro (https://link.medium.com/0B9vt7DUfib) • Design patterns for modern web APIs by D Luecke (https://blog.feathersjs.com/design-patterns-for-modern-web-apis-1f046635215) • The design of web APIs by A Lauret (https://www.manning.com/books/the- design-of-web-apis) • API Design Patterns by JJ Geewax (https://www.manning.com/books/api-design- patterns)