SlideShare a Scribd company logo
Schema-First API Design
with OpenAPI / Swagger
Yos Riady
yos.io
bit.ly/2uDyaSN
API Design process
What is OpenAPI?
Introduction Design Spec Tools Conclusion
Writing OpenAPI specs
Summary and further
learning
Tooling around
OpenAPI
You’re building an API
● You need to:
○ Update the server implementation to support the new feature.
○ Update all client libraries / SDKs.
○ Update the documentation.
● All the above must be consistent with each other.
● Also, frontend teams are blocked until your backend API is complete.
Adding a new feature to the API
Is there a better way to do this?
Schema-First API Design
The Schema-first API design approach means writing your API definition first in
one of many API Specification languages before writing any code.
Iterate faster in teams
Benefits of the Schema-First Approach
Generate ArtifactsGenerate API Tests
You can generate mock
services for clients to work
with, even before backend
components are ready.
Your API Specification can
be used to generate
functional tests for the API.
Your API Specification can
be used to generate SDKs,
documentation, and server
scaffolds.
API Specification Languages
API Design process
What is OpenAPI?
Introduction Design Spec Tools Conclusion
Writing OpenAPI specs
Summary and further
learning
Tooling around
OpenAPI
OpenAPI / Swagger
What’s in an OpenAPI Specification?
● General information about the API
● Available paths e.g. /resources
○ Available operations on each path e.g. GET /resources/{id}
○ input & output for each operation
openapi: 3.0.0
info:
title: Sample API
description: Optional multiline or single-line description
version: 0.1.9
paths:
/users:
get:
summary: Returns a list of users.
description: Optional extended description in CommonMark or HTML.
responses:
'200': # status code
description: A JSON array of user names
content:
application/json:
schema:
type: array
items:
type: string
editor.swagger.io
Writing an OpenAPI Specification: openapi
openapi: 3.0.0
The semantic version number of the
OpenAPI Specification version that
the OpenAPI document uses.
The info section provides
general information about the
API.
info:
title: Sample Pet Store App
version: 1.0.1
description: This is a sample server for a pet store.
termsOfService: http://example.com/terms/
contact:
name: API Support
url: http://www.example.com/support
email: support@example.com
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
Writing an OpenAPI Specification: info
Writing an OpenAPI Specification: paths
The paths section contains the
endpoints such as /products and
operations are the HTTP methods
such as GET, POST, DELETE
paths:
/products/{id}:
get: <operation>
/orders:
post: <operation>
paths:
/products/{id}:
get:
operationId: getProductById
parameters:
- name: id
in: path
description: Product ID
required: true
schema:
type: integer
format: int64
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
Writing an OpenAPI Specification: paths
Each operation documents any
parameters for the operation, the
different kinds of responses, and
other metadata.
Writing an OpenAPI Specification: components
components:
schemas: # Schema object definition
Pet:
type: object
properties:
name:
type: string
petType:
type: string
required:
- name
- petType
The components section lets you
define common data structures
used in your API. They can be
referenced via $ref whenever a
schema is required:
$ref: '#/components/schemas/Pet'
editor.swagger.io
And more!
There are tons of
libraries and
frameworks that
support the OpenAPI
ecosystem.
Swagger Codegen
Generates server
stubs and client
libraries in over 40
languages /
platforms.
Tooling around OpenAPI
Swagger UI
Generate interactive
API documentation
that lets users try out
API calls in the
browser.
Schema-First API Design
API Design process
What is OpenAPI?
Introduction Design Spec Tools Conclusion
Writing OpenAPI specs
Summary and further
learning
Tooling around
OpenAPI
Schema-First API Design
with OpenAPI / Swagger
Yos Riady
yos.io
bit.ly/2uDyaSN
Q&A

More Related Content

What's hot (20)

PPTX
Terraform on Azure
Julien Corioland
 
PPTX
Introduction to Kubernetes
rajdeep
 
PDF
Opa gatekeeper
Rita Zhang
 
PPTX
Hive, Presto, and Spark on TPC-DS benchmark
Dongwon Kim
 
PPTX
Elastic stack Presentation
Amr Alaa Yassen
 
PDF
Authorization and Authentication in Microservice Environments
LeanIX GmbH
 
PDF
Helm - Application deployment management for Kubernetes
Alexei Ledenev
 
PDF
The Architecture of an API Platform
Johannes Ridderstedt
 
PPTX
Domain Driven Design & Hexagonal Architecture
Can Pekdemir
 
PPTX
Migrating .NET Application to .NET Core
Baris Ceviz
 
PDF
Introduction to Kubernetes and GKE
Opsta
 
PPTX
Understanding REST APIs in 5 Simple Steps
Tessa Mero
 
PPTX
API Presentation
nityakulkarni
 
PDF
Apicurio Registry: Event-driven APIs & Schema governance for Apache Kafka | F...
HostedbyConfluent
 
PPTX
Firebase PPT
JATIN GUPTA
 
PPTX
414: Build an agile CI/CD Pipeline for application integration
Trevor Dolby
 
PDF
Argocd up and running
Raphaël PINSON
 
PDF
GraphQL vs REST
GreeceJS
 
PPSX
Rest api standards and best practices
Ankita Mahajan
 
PDF
API Design, A Quick Guide to REST, SOAP, gRPC, and GraphQL, By Vahid Rahimian
Vahid Rahimian
 
Terraform on Azure
Julien Corioland
 
Introduction to Kubernetes
rajdeep
 
Opa gatekeeper
Rita Zhang
 
Hive, Presto, and Spark on TPC-DS benchmark
Dongwon Kim
 
Elastic stack Presentation
Amr Alaa Yassen
 
Authorization and Authentication in Microservice Environments
LeanIX GmbH
 
Helm - Application deployment management for Kubernetes
Alexei Ledenev
 
The Architecture of an API Platform
Johannes Ridderstedt
 
Domain Driven Design & Hexagonal Architecture
Can Pekdemir
 
Migrating .NET Application to .NET Core
Baris Ceviz
 
Introduction to Kubernetes and GKE
Opsta
 
Understanding REST APIs in 5 Simple Steps
Tessa Mero
 
API Presentation
nityakulkarni
 
Apicurio Registry: Event-driven APIs & Schema governance for Apache Kafka | F...
HostedbyConfluent
 
Firebase PPT
JATIN GUPTA
 
414: Build an agile CI/CD Pipeline for application integration
Trevor Dolby
 
Argocd up and running
Raphaël PINSON
 
GraphQL vs REST
GreeceJS
 
Rest api standards and best practices
Ankita Mahajan
 
API Design, A Quick Guide to REST, SOAP, gRPC, and GraphQL, By Vahid Rahimian
Vahid Rahimian
 

Similar to Schema-First API Design (20)

PDF
Designing APIs with OpenAPI Spec
Adam Paxton
 
PPTX
API Docs with OpenAPI 3.0
Fabrizio Ferri-Benedetti
 
PPTX
SVQdotNET: Building APIs with OpenApi
Juan Luis Guerrero Minero
 
PDF
Get Your Node.js API Swaggering with OpenAPI Spec
Adam Paxton
 
PDF
Presentation at the 2016 Linux Foundation Collab Summit
Open API Initiative (OAI)
 
PDF
Building APIs with the OpenApi Spec
Pedro J. Molina
 
PPTX
The Swagger Format becomes the Open API Specification: Standardizing descript...
3scale
 
PDF
Always up to date, testable and maintainable documentation with OpenAPI
GOG.com dev team
 
PPTX
Open API Specifications - formerly swagger
Pradeep Kumar
 
PPTX
Rest API with Swagger and NodeJS
Luigi Saetta
 
PPTX
OWASP PDX May 2016 : Scanning with Swagger (OAS) 2.0
Scott Lee Davis
 
PDF
Designing APIs with Swagger and OpenAPI 1st Edition Joshua S. Ponelat
tatajebezad
 
PDF
Enforcing API Design Rules for High Quality Code Generation
Tim Burks
 
PPTX
Open API Initiative: Six months and counting
Open API Initiative (OAI)
 
PDF
9 Months and Counting with Jeff Borek of IBM OpenAPI Meetup 2016 09 15
Open API Initiative (OAI)
 
PDF
Streamlining API with Swagger.io
Victor Augusteo
 
PPTX
Automatic discovery of Web API Specifications: an example-driven approach
Jordi Cabot
 
PPTX
Example-driven Web API Specification Discovery
Javier Canovas
 
PDF
"Design First" APIs with Swagger
scolestock
 
PPTX
Build Swagger definition - Sample
j_copete
 
Designing APIs with OpenAPI Spec
Adam Paxton
 
API Docs with OpenAPI 3.0
Fabrizio Ferri-Benedetti
 
SVQdotNET: Building APIs with OpenApi
Juan Luis Guerrero Minero
 
Get Your Node.js API Swaggering with OpenAPI Spec
Adam Paxton
 
Presentation at the 2016 Linux Foundation Collab Summit
Open API Initiative (OAI)
 
Building APIs with the OpenApi Spec
Pedro J. Molina
 
The Swagger Format becomes the Open API Specification: Standardizing descript...
3scale
 
Always up to date, testable and maintainable documentation with OpenAPI
GOG.com dev team
 
Open API Specifications - formerly swagger
Pradeep Kumar
 
Rest API with Swagger and NodeJS
Luigi Saetta
 
OWASP PDX May 2016 : Scanning with Swagger (OAS) 2.0
Scott Lee Davis
 
Designing APIs with Swagger and OpenAPI 1st Edition Joshua S. Ponelat
tatajebezad
 
Enforcing API Design Rules for High Quality Code Generation
Tim Burks
 
Open API Initiative: Six months and counting
Open API Initiative (OAI)
 
9 Months and Counting with Jeff Borek of IBM OpenAPI Meetup 2016 09 15
Open API Initiative (OAI)
 
Streamlining API with Swagger.io
Victor Augusteo
 
Automatic discovery of Web API Specifications: an example-driven approach
Jordi Cabot
 
Example-driven Web API Specification Discovery
Javier Canovas
 
"Design First" APIs with Swagger
scolestock
 
Build Swagger definition - Sample
j_copete
 
Ad

More from Yos Riady (10)

PDF
Brief introduction to Serverless (2018)
Yos Riady
 
PDF
Type Checking in Javascript with Flow
Yos Riady
 
PDF
Writing Domain Specific Languages with JSON Schema
Yos Riady
 
PDF
GraphQL in an Age of REST
Yos Riady
 
PDF
Python List Comprehensions
Yos Riady
 
PDF
Ruby on Rails Workshop
Yos Riady
 
PDF
Online Payments and You
Yos Riady
 
PDF
Entity Component Systems
Yos Riady
 
PDF
Introduction to React
Yos Riady
 
PPTX
Intro to Web Map APIs
Yos Riady
 
Brief introduction to Serverless (2018)
Yos Riady
 
Type Checking in Javascript with Flow
Yos Riady
 
Writing Domain Specific Languages with JSON Schema
Yos Riady
 
GraphQL in an Age of REST
Yos Riady
 
Python List Comprehensions
Yos Riady
 
Ruby on Rails Workshop
Yos Riady
 
Online Payments and You
Yos Riady
 
Entity Component Systems
Yos Riady
 
Introduction to React
Yos Riady
 
Intro to Web Map APIs
Yos Riady
 
Ad

Recently uploaded (20)

PDF
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
PPT
Brief History of Python by Learning Python in three hours
adanechb21
 
PDF
AWS_Agentic_AI_in_Indian_BFSI_A_Strategic_Blueprint_for_Customer.pdf
siddharthnetsavvies
 
PDF
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
PPTX
Explanation about Structures in C language.pptx
Veeral Rathod
 
PDF
Troubleshooting Virtual Threads in Java!
Tier1 app
 
PDF
Adobe Illustrator Crack Full Download (Latest Version 2025) Pre-Activated
imang66g
 
PPT
Activate_Methodology_Summary presentatio
annapureddyn
 
PDF
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
PDF
What companies do with Pharo (ESUG 2025)
ESUG
 
PDF
SAP GUI Installation Guide for Windows | Step-by-Step Setup for SAP Access
SAP Vista, an A L T Z E N Company
 
PPTX
Farrell__10e_ch04_PowerPoint.pptx Programming Logic and Design slides
bashnahara11
 
PPTX
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
PDF
Virtual Threads in Java: A New Dimension of Scalability and Performance
Tier1 app
 
PPTX
Presentation about variables and constant.pptx
kr2589474
 
PPTX
TRAVEL APIs | WHITE LABEL TRAVEL API | TOP TRAVEL APIs
philipnathen82
 
PDF
Infrastructure planning and resilience - Keith Hastings.pptx.pdf
Safe Software
 
PPTX
Role Of Python In Programing Language.pptx
jaykoshti048
 
PPTX
Employee salary prediction using Machine learning Project template.ppt
bhanuk27082004
 
PPTX
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
Brief History of Python by Learning Python in three hours
adanechb21
 
AWS_Agentic_AI_in_Indian_BFSI_A_Strategic_Blueprint_for_Customer.pdf
siddharthnetsavvies
 
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
Explanation about Structures in C language.pptx
Veeral Rathod
 
Troubleshooting Virtual Threads in Java!
Tier1 app
 
Adobe Illustrator Crack Full Download (Latest Version 2025) Pre-Activated
imang66g
 
Activate_Methodology_Summary presentatio
annapureddyn
 
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
What companies do with Pharo (ESUG 2025)
ESUG
 
SAP GUI Installation Guide for Windows | Step-by-Step Setup for SAP Access
SAP Vista, an A L T Z E N Company
 
Farrell__10e_ch04_PowerPoint.pptx Programming Logic and Design slides
bashnahara11
 
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
Virtual Threads in Java: A New Dimension of Scalability and Performance
Tier1 app
 
Presentation about variables and constant.pptx
kr2589474
 
TRAVEL APIs | WHITE LABEL TRAVEL API | TOP TRAVEL APIs
philipnathen82
 
Infrastructure planning and resilience - Keith Hastings.pptx.pdf
Safe Software
 
Role Of Python In Programing Language.pptx
jaykoshti048
 
Employee salary prediction using Machine learning Project template.ppt
bhanuk27082004
 
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 

Schema-First API Design

  • 1. Schema-First API Design with OpenAPI / Swagger Yos Riady yos.io bit.ly/2uDyaSN
  • 2. API Design process What is OpenAPI? Introduction Design Spec Tools Conclusion Writing OpenAPI specs Summary and further learning Tooling around OpenAPI
  • 4. ● You need to: ○ Update the server implementation to support the new feature. ○ Update all client libraries / SDKs. ○ Update the documentation. ● All the above must be consistent with each other. ● Also, frontend teams are blocked until your backend API is complete. Adding a new feature to the API
  • 5. Is there a better way to do this?
  • 6. Schema-First API Design The Schema-first API design approach means writing your API definition first in one of many API Specification languages before writing any code.
  • 7. Iterate faster in teams Benefits of the Schema-First Approach Generate ArtifactsGenerate API Tests You can generate mock services for clients to work with, even before backend components are ready. Your API Specification can be used to generate functional tests for the API. Your API Specification can be used to generate SDKs, documentation, and server scaffolds.
  • 9. API Design process What is OpenAPI? Introduction Design Spec Tools Conclusion Writing OpenAPI specs Summary and further learning Tooling around OpenAPI
  • 11. What’s in an OpenAPI Specification? ● General information about the API ● Available paths e.g. /resources ○ Available operations on each path e.g. GET /resources/{id} ○ input & output for each operation
  • 12. openapi: 3.0.0 info: title: Sample API description: Optional multiline or single-line description version: 0.1.9 paths: /users: get: summary: Returns a list of users. description: Optional extended description in CommonMark or HTML. responses: '200': # status code description: A JSON array of user names content: application/json: schema: type: array items: type: string
  • 14. Writing an OpenAPI Specification: openapi openapi: 3.0.0 The semantic version number of the OpenAPI Specification version that the OpenAPI document uses.
  • 15. The info section provides general information about the API. info: title: Sample Pet Store App version: 1.0.1 description: This is a sample server for a pet store. termsOfService: http://example.com/terms/ contact: name: API Support url: http://www.example.com/support email: [email protected] license: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html Writing an OpenAPI Specification: info
  • 16. Writing an OpenAPI Specification: paths The paths section contains the endpoints such as /products and operations are the HTTP methods such as GET, POST, DELETE paths: /products/{id}: get: <operation> /orders: post: <operation>
  • 17. paths: /products/{id}: get: operationId: getProductById parameters: - name: id in: path description: Product ID required: true schema: type: integer format: int64 responses: '200': content: application/json: schema: $ref: '#/components/schemas/Product' Writing an OpenAPI Specification: paths Each operation documents any parameters for the operation, the different kinds of responses, and other metadata.
  • 18. Writing an OpenAPI Specification: components components: schemas: # Schema object definition Pet: type: object properties: name: type: string petType: type: string required: - name - petType The components section lets you define common data structures used in your API. They can be referenced via $ref whenever a schema is required: $ref: '#/components/schemas/Pet'
  • 20. And more! There are tons of libraries and frameworks that support the OpenAPI ecosystem. Swagger Codegen Generates server stubs and client libraries in over 40 languages / platforms. Tooling around OpenAPI Swagger UI Generate interactive API documentation that lets users try out API calls in the browser.
  • 22. API Design process What is OpenAPI? Introduction Design Spec Tools Conclusion Writing OpenAPI specs Summary and further learning Tooling around OpenAPI
  • 23. Schema-First API Design with OpenAPI / Swagger Yos Riady yos.io bit.ly/2uDyaSN
  • 24. Q&A