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
Design First Web APIs - OpenAPI 3
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Roger Camargo
June 02, 2021
Programming
1
110
Design First Web APIs - OpenAPI 3
Design first web APIs and why Django did not help!
Roger Camargo
June 02, 2021
Tweet
Share
More Decks by Roger Camargo
See All by Roger Camargo
AWS Lambda, Rodar local, com testes, IaC e Deploy via ansible
huogerac
1
25
Mapa de estudo dev frontend 2023
huogerac
1
86
Documentando API no Django com django-ninja
huogerac
1
120
Um pouco da origem para chegar no WSGI
huogerac
0
50
"API Design First" pt-br
huogerac
0
270
3 Arquiteturas Django
huogerac
1
320
Django ORM vs SQLAlchemy (queries)
huogerac
0
180
Django ORM vs SQLAlchemy (intro)
huogerac
0
95
Site Imobiliario Django
huogerac
0
110
Other Decks in Programming
See All in Programming
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
290
Implementation Patterns
denyspoltorak
0
280
AI & Enginnering
codelynx
0
110
Oxlintはいいぞ
yug1224
5
1.3k
今から始めるClaude Code超入門
448jp
7
8.2k
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
2.7k
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6k
2026年 エンジニアリング自己学習法
yumechi
0
130
CSC307 Lecture 06
javiergs
PRO
0
680
フロントエンド開発の勘所 -複数事業を経験して見えた判断軸の違い-
heimusu
7
2.8k
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
150
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
170
Featured
See All Featured
Color Theory Basics | Prateek | Gurzu
gurzu
0
190
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.4k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
170
Ethics towards AI in product and experience design
skipperchong
2
190
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
Embracing the Ebb and Flow
colly
88
5k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
71
Transcript
Design first APIs and why Django did not help! by
Roger Camargo - Jun/2021
Design first APIs and why Django did not help! WEB
by Roger Camargo - Jun/2021
DISCLAIMER
Why API?
Backend Data Frontend API Code is the documentation. (It’s okay)
👉
Backend Data Client 1 API Client 2 Where is the
API documentation? 👉
Backend Data Client 1 API System A SDK Client JS
System B Client 2
Backend Data Client 1 API Client 2 System A SDK
Client JS System B Internet It can be hard to keep an API documentation updated... 👉
How to use your API? What are the endpoints? Methods?
Status codes??
How to use your API? What are the endpoints? Methods?
Status codes?? https://http.cat/
/users Code-First, Write Docs "When We Have Time" 👉 It
means "We will not write documentation"
201 API Specs/Docs
👉 It can fail to maintain parity between our documentation
and our underlying implementation API Specs/Docs
OpenAPI Specification (OAS3)
What is OAS3? - Contract for defining RESTful APIs -
Source of truth for everyone - Open source, evolving standard - Collection of tools - Language-agnostic - Readable by both humans and machines
What is OAS3? - Design by contract (YAML) (The pragmatic
programmer) - Get feedback on the API before coding - Easier to make changes - One source of truth - Generate code, mock, tests, docs etc...
Wait... Big design up front?
https://editor.swagger.io/ 👉 One source of truth
https://github.com/zalando/connexion 👉
Low coupling, High cohesion
api.py YAML service.py (CONTRACT) Routes Request validation Response validation Schema
casting FACADE API Layer Business Layer DATA ORM
Django land...
Models Managers TEMPLATE FILTERS Exception Middlewares View Exception Handlers
/polls/
Django It’s hard to produce API Guided by the YAML
contract...
However, there is django-ninja DOCS Code first, but there is
an API documentation 👉
The design first way… (Flask, Falcon etc…)
Automatic live documentation API Mock server Frontend For quick UX
validation Quick feedback Frontend TEAM Backend TEAM Real Implementation API Tests Business Tests Minimize the ReWork YAML
Design first API Links: https://swagger.io/resources/webinars/adopting-a-design-first-approach/ https://apisyouwonthate.com/blog/api-design-first-vs-code-first https://docs.djangoproject.com/en/3.2/ref/request-response/ https://www.openapis.org/ https://github.com/zalando/connexion https://http.cat/
Tools: https://editor.swagger.io/ https://stoplight.io/ Code sample: https://github.com/billcode/jarless Books https://www.goodreads.com/book/show/4099.The_Pragmatic_Programmer
THANK YOU Keep in touch @huogerac https://huogerac.hashnode.dev
[email protected]
https://speakerdeck.com/huogerac