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
120
1
Share
Design First Web APIs - OpenAPI 3
Design first web APIs and why Django did not help!
Roger Camargo
June 02, 2021
More Decks by Roger Camargo
See All by Roger Camargo
AWS Lambda, Rodar local, com testes, IaC e Deploy via ansible
huogerac
1
33
Mapa de estudo dev frontend 2023
huogerac
1
90
Documentando API no Django com django-ninja
huogerac
1
130
Um pouco da origem para chegar no WSGI
huogerac
0
54
"API Design First" pt-br
huogerac
0
280
3 Arquiteturas Django
huogerac
1
340
Django ORM vs SQLAlchemy (queries)
huogerac
0
190
Django ORM vs SQLAlchemy (intro)
huogerac
0
100
Site Imobiliario Django
huogerac
0
120
Other Decks in Programming
See All in Programming
不変条件と整合性境界—ビジネスが決める設計判断と実現パターン / Invariants and Consistency Boundaries
nrslib
11
3k
分析エージェント精度向上における データアナリストの役割
oura_shoya
0
130
Old Dog, New Tricks: The Java 25 Reinvention - JNation
bazlur_rahman
0
130
Talking to terminals (and how they talk back) (KotlinConf 2026)
jakewharton
PRO
1
160
バックエンドにElysiaJSを採用して気付いた、良い点・悪い点
wanko_it
1
190
Modding RubyKaigi for Myself
yui_knk
0
790
Inspired By RubyKaigi (EN)
atzzcokek
0
420
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
410
AI時代だからこそ「Bloc」を採用する価値があるのかもしれない
takuroabe
0
260
プロパティの順序で型推論が壊れる!? TypeScript6.0の修正からContext-Sensitivityの仕組みを追う
bicstone
2
1.2k
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
740
Technical Debt: Understanding it Rightly, Engaging it Rightly #LaravelLiveJP
shogogg
0
170
Featured
See All Featured
The Language of Interfaces
destraynor
162
26k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Skip the Path - Find Your Career Trail
mkilby
1
130
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.2k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
70
39k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
The browser strikes back
jonoalderson
0
1.1k
How to train your dragon (web standard)
notwaldorf
97
6.6k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
180
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2k
How to make the Groovebox
asonas
2
2.2k
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