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
Roger Camargo
June 02, 2021
Programming
1
78
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
Mapa de estudo dev frontend 2023
huogerac
1
68
Documentando API no Django com django-ninja
huogerac
1
100
Um pouco da origem para chegar no WSGI
huogerac
0
24
"API Design First" pt-br
huogerac
0
260
3 Arquiteturas Django
huogerac
1
230
Django ORM vs SQLAlchemy (queries)
huogerac
0
150
Django ORM vs SQLAlchemy (intro)
huogerac
0
88
Site Imobiliario Django
huogerac
0
86
CMS Django com magic content
huogerac
0
100
Other Decks in Programming
See All in Programming
Ruby on cygwin 2025-02
fd0
0
140
“あなた” の開発を支援する AI エージェント Bedrock Engineer / introducing-bedrock-engineer
gawa
11
1.9k
Flutter × Firebase Genkit で加速する生成 AI アプリ開発
coborinai
0
150
JavaScriptツール群「UnJS」を5分で一気に駆け巡る!
k1tikurisu
9
1.8k
CI改善もDatadogとともに
taumu
0
110
Honoをフロントエンドで使う 3つのやり方
yusukebe
7
3.1k
Domain-Driven Transformation
hschwentner
2
1.9k
Unity Android XR入門
sakutama_11
0
150
最近のVS Codeで気になるニュース 2025/01
74th
1
260
GoとPHPのインターフェイスの違い
shimabox
2
170
Amazon Q Developer Proで効率化するAPI開発入門
seike460
PRO
0
110
Linux && Docker 研修/Linux && Docker training
forrep
24
4.5k
Featured
See All Featured
Side Projects
sachag
452
42k
Being A Developer After 40
akosma
89
590k
The Pragmatic Product Professional
lauravandoore
32
6.4k
Adopting Sorbet at Scale
ufuk
74
9.2k
How STYLIGHT went responsive
nonsquared
98
5.4k
Navigating Team Friction
lara
183
15k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
630
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
1k
Build The Right Thing And Hit Your Dates
maggiecrowley
34
2.5k
How to train your dragon (web standard)
notwaldorf
91
5.8k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
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