Share
Embed
APIs do Jeito Certo
Um apanhado geral sobre APIs, incluindo Design-first, OAS, Restful e instrumental.
Er Galvão Abbott
December 13, 2024
Annual Pro sale · Save $30
Have presentations of your own?
Share with private links, password protection, and more control over your work.
Transcript
81 slides
-
CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott -
12/13/24 - 1 / 81 galvao.eti.br v 1.2.0 - 2024-12-07 APIs do jeito certo -
Atua há 30 anos no Mercado de TI: Programador (>
25), Professor / Palestrante (> 20) e Consultor (> 25) Engenheiro de Software Sênior / Tech Lead Professor Convidado (Especialista) de Pós-Graduação (PR e SC) Diretor, ConFLOSS, NodeConBR e PHP Conference Brasil Evangelista e Contribuidor para a Linguagem PHP Evangelista e Contribuidor para o Laminas Project Primeiro Brasileiro a se tornar Postman Supernova Presidente da ABRAPHP – Associação Brasileira de Profissionais PHP Apaixonado por Backend, APIs, Qualidade, Segurança e Software Livre galvao.eti.br galvao.eti.br Meu nome é Galvão CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 12/13/2024 – v0.2.0 – Slide 2 / 81 -
galvao.eti.br Objetivo CC Attribution-ShareAlike 3.0 Unported License by Er Galvão
Abbott - 12/13/24 - 3 / 81 Apresentar um apanhado geral sobre APIs, incluindo: • Design-First • OpenAPI Specification • Ciclo de desenvolvimento • ReST(ful) • e instrumental. -
APIs...? galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão
Abbott - 12/13/24 - 4 / 81 -
APIs FTW! galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er
Galvão Abbott - 12/13/24 - 5 / 81 APIs? -
APIs FTW! galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er
Galvão Abbott - 12/13/24 - 6 / 81 APIs? strlen( string $str ) → int -
APIs FTW! galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er
Galvão Abbott - 12/13/24 - 7 / 81 APIs? strlen( string $str ) → int ponto de acesso -
APIs FTW! galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er
Galvão Abbott - 12/13/24 - 8 / 81 APIs? strlen( string $str ) → int ponto de acesso informação -
APIs FTW! galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er
Galvão Abbott - 12/13/24 - 9 / 81 APIs? strlen( string $str ) → int ponto de acesso informação resultado -
APIs FTW! galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er
Galvão Abbott - 12/13/24 - 10 / 81 APIs? strlen( string $str ) → int https://whatevers/product/1109 → {...} -
APIs FTW! galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er
Galvão Abbott - 12/13/24 - 11 / 81 APIs? strlen( string $str ) → int https://whatevers/product/1109 → {...} ponto de acesso -
APIs FTW! galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er
Galvão Abbott - 12/13/24 - 12 / 81 APIs? strlen( string $str ) → int https://whatevers/product/1109 → {...} ponto de acesso informação -
APIs FTW! galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er
Galvão Abbott - 12/13/24 - 13 / 81 APIs? strlen( string $str ) → int https://whatevers/product/1109 → {...} ponto de acesso informação resultado -
Por que toda a aplicação deveria ser desenvolvida como uma
API? galvao.eti.br Por que APIs CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 12/13/24 - 14 / 81 -
Por que toda a aplicação deveria ser desenvolvida como uma
API? galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 12/13/24 - 15 / 81 Por que APIs -
Por que toda a aplicação deveria ser desenvolvida como uma
API? galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 12/13/24 - 16 / 81 Por que APIs + Verdadeira Separação entre Back e Front -
Por que toda a aplicação deveria ser desenvolvida como uma
API? galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 12/13/24 - 17 / 81 Por que APIs + Verdadeira Separação entre Back e Front + Agnosticismo de linguagens -
Por que toda a aplicação deveria ser desenvolvida como uma
API? galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 12/13/24 - 18 / 81 Por que APIs + Verdadeira Separação entre Back e Front + Agnosticismo de linguagens + Otimização de Performance de backend -
Por que toda a aplicação deveria ser desenvolvida como uma
API? galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 12/13/24 - 19 / 81 Por que APIs + Verdadeira Separação entre Back e Front + Agnosticismo de linguagens + Otimização de Performance de backend + Um back*, múltiplos fronts -
Por que toda a aplicação deveria ser desenvolvida como uma
API? galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 12/13/24 - 20 / 81 Por que APIs + Verdadeira Separação entre Back e Front + Agnosticismo de linguagens + Otimização de Performance de backend + Um back*, múltiplos fronts + Escalabilidade* -
Por que toda a aplicação deveria ser desenvolvida como uma
API? galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 12/13/24 - 21 / 81 Por que APIs + Verdadeira Separação entre Back e Front + Agnosticismo de linguagens + Otimização de Performance de backend + Um back*, múltiplos fronts + Escalabilidade* * Ou, até mesmo, múltiplos backs e fronts -
Por que Design-First? galvao.eti.br Por que Design-First? CC Attribution-ShareAlike 3.0
Unported License by Er Galvão Abbott - 12/13/24 - 22 / 81 -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 23 / 81 Por que Design-First? -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 24 / 81 Por que Design-First? -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 25 / 81 x Por que Design-First? -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 26 / 81 x Por que Design-First? -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 27 / 81 x Por que Design-First? -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 28 / 81 x Por que Design-First? -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 29 / 81 x Por que Design-First? -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 30 / 81 x Por que Design-First? -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 31 / 81 Por que Design-First? openapis.org -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 32 / 81 Por que Design-First? ... paths openapis.org -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 33 / 81 Por que Design-First? ... paths + components openapis.org -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 34 / 81 Por que Design-First? ... paths + components + $ref ... openapis.org -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 35 / 81 Por que Design-First? -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 36 / 81 Por que Design-First? Zero Code -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 37 / 81 Por que Design-First? Zero Code Code -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 38 / 81 Por que ReST? Por que ReST? -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 39 / 81 Por que ReST? -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 40 / 81 + Client-Server Por que ReST? -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 41 / 81 + Client-Server + Stateless - não existe persistência de estado Por que ReST? -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 42 / 81 + Client-Server + Stateless - não existe persistência de estado + Cache - Declaração explícita se a resposta é cacheável Por que ReST? -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 43 / 81 + Client-Server + Stateless - não existe persistência de estado + Cache - Declaração explícita se a resposta é cacheável + Uniformidade de Interface Por que ReST? -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 44 / 81 + Client-Server + Stateless - não existe persistência de estado + Cache - Declaração explícita se a resposta é cacheável + Uniformidade de Interface + Camadas - Impossibilidade de determinar “tipo” de conexão Por que ReST? -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 45 / 81 … e, além disso... … e, além disso... -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 46 / 81 … e, além disso... SQL HTTP(S) C R U D -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 47 / 81 … e, além disso... SQL HTTP(S) Create Retrieve Update Delete -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 48 / 81 … e, além disso... INSERT SQL HTTP(S) Create Retrieve Update Delete -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 49 / 81 … e, além disso... INSERT SQL HTTP(S) Create Retrieve Update Delete POST -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 50 / 81 … e, além disso... INSERT SELECT SQL HTTP(S) Create Retrieve Update Delete POST -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 51 / 81 … e, além disso... INSERT SELECT SQL HTTP(S) Create Retrieve Update Delete POST GET -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 52 / 81 … e, além disso... INSERT SELECT UPDATE SQL HTTP(S) Create Retrieve Update Delete POST GET -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 53 / 81 … e, além disso... INSERT SELECT UPDATE SQL HTTP(S) Create Retrieve Update Delete POST GET PATCH / PUT -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 54 / 81 … e, além disso... INSERT SELECT UPDATE DELETE SQL HTTP(S) Create Retrieve Update Delete POST GET PATCH / PUT -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 55 / 81 … e, além disso... INSERT SELECT UPDATE DELETE SQL HTTP(S) Create Retrieve Update Delete POST GET PATCH / PUT DELETE -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 56 / 81 httpstatuses.com … e, além disso... ‘bora falar de status HTTP? -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 57 / 81 httpstatuses.com … e, além disso... Sim, precisamos falar de status HTTP... -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 58 / 81 httpstatuses.com Mais … e, além disso... -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 59 / 81 httpstatuses.com Mais 201, 204, 401, 403, 404, 405, 406, 413, 429... … e, além disso... -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 60 / 81 httpstatuses.com Mais 201, 204, 401, 403, 404, 405, 406, 413, 429... Menos … e, além disso... -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 61 / 81 httpstatuses.com Mais 201, 204, 401, 403, 404, 405, 406, 413, 429... Menos 200, 400. … e, além disso... -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 62 / 81 httpstatuses.com Mais 201, 204, 401, 403, 404, 405, 406, 413, 429... Menos 200, 400. Nunca* … e, além disso... -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 63 / 81 httpstatuses.com Mais 201, 204, 401, 403, 404, 405, 406, 413, 429... Menos 200, 400. Nunca* 5xx. … e, além disso... -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 64 / 81 Create Retrieve Update Delete INSERT SELECT UPDATE DELETE POST GET PATCH / PUT DELETE SQL HTTP(S) Response … e, além disso... -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 65 / 81 Create Retrieve Update Delete INSERT SELECT UPDATE DELETE POST GET PATCH / PUT DELETE SQL HTTP(S) Response 201 … e, além disso... -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 66 / 81 Create Retrieve Update Delete INSERT SELECT UPDATE DELETE POST GET PATCH / PUT DELETE SQL HTTP(S) Response 201 200 … e, além disso... -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 67 / 81 Create Retrieve Update Delete INSERT SELECT UPDATE DELETE POST GET PATCH / PUT DELETE SQL HTTP(S) Response 201 200 204 … e, além disso... -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 68 / 81 Create Retrieve Update Delete INSERT SELECT UPDATE DELETE POST GET PATCH / PUT DELETE SQL HTTP(S) Response 201 200 204 204 … e, além disso... -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 69 / 81 FERRAMENTAS! FERRAMENTAS! -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 70 / 81 • Documentation • Linting • Mocking • Proxying • Testing FERRAMENTAS! -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 71 / 81 LINTING spectral - stoplight.io/open-source/spectral Postman - postman.com -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 72 / 81 MOCKING prism - stoplight.io/open-source/prism Postman - postman.com -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 73 / 81 DOCUMENTATION elements - stoplight.io/open-source/elements redoc-cli - yarnpkg.com/package/redoc-cli Postman - postman.com -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 74 / 81 PROXYING prism - stoplight.io/open-source/prism Postman - postman.com -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 75 / 81 TESTING httpie.io http-prompt - github.com/httpie/http-prompt Postman - postman.com usebruno.com terminaltrove.com/atac -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 76 / 81 http-prompt x -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 77 / 81 + http-prompt -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 78 / 81 http-prompt Performance Testes Rápidos Pipeline -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 79 / 81 “Tudo-em-um” Gerência de grandes APIs Replayability Features que são melhores em aplicações GUI E mais... -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 12/13/24 - 80 / 81 Concluindo... -
galvao.eti.br Muito Obrigado! CC Attribution-ShareAlike 3.0 Unported License by Er
Galvão Abbott - 12/13/24 - 81 / 81 Dúvidas, Críticas, Elogios, etc…? ‘bora conversar!