SlideShare una empresa de Scribd logo
1 de 24
Descargar para leer sin conexión
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.
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

Más contenido relacionado

La actualidad más candente

Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services ArchitectureAraf Karsh Hamid
 
Designing APIs with OpenAPI Spec
Designing APIs with OpenAPI SpecDesigning APIs with OpenAPI Spec
Designing APIs with OpenAPI SpecAdam Paxton
 
API Governance and GitOps in Hybrid Integration Platform (MuleSoft)
API Governance and GitOps in Hybrid Integration Platform (MuleSoft)API Governance and GitOps in Hybrid Integration Platform (MuleSoft)
API Governance and GitOps in Hybrid Integration Platform (MuleSoft)Sumanth Donthi
 
Document your rest api using swagger - Devoxx 2015
Document your rest api using swagger - Devoxx 2015Document your rest api using swagger - Devoxx 2015
Document your rest api using swagger - Devoxx 2015johannes_fiala
 
Introducing OpenAPI Version 3.1
Introducing OpenAPI Version 3.1Introducing OpenAPI Version 3.1
Introducing OpenAPI Version 3.1SmartBear
 
Architecting an Enterprise API Management Strategy
Architecting an Enterprise API Management StrategyArchitecting an Enterprise API Management Strategy
Architecting an Enterprise API Management StrategyWSO2
 
Introduction to REST - API
Introduction to REST - APIIntroduction to REST - API
Introduction to REST - APIChetan Gadodia
 
API Management in Digital Transformation
API Management in Digital TransformationAPI Management in Digital Transformation
API Management in Digital TransformationAditya Thatte
 
The Architecture of an API Platform
The Architecture of an API PlatformThe Architecture of an API Platform
The Architecture of an API PlatformJohannes Ridderstedt
 
Open API and API Management - Introduction and Comparison of Products: TIBCO ...
Open API and API Management - Introduction and Comparison of Products: TIBCO ...Open API and API Management - Introduction and Comparison of Products: TIBCO ...
Open API and API Management - Introduction and Comparison of Products: TIBCO ...Kai Wähner
 
Enforcing Your Organization's API Design Standards with SwaggerHub
Enforcing Your Organization's API Design Standards with SwaggerHubEnforcing Your Organization's API Design Standards with SwaggerHub
Enforcing Your Organization's API Design Standards with SwaggerHubSmartBear
 
Api-First service design
Api-First service designApi-First service design
Api-First service designStefaan Ponnet
 
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API GatewayMark Bate
 
API Management - Why it matters!
API Management - Why it matters!API Management - Why it matters!
API Management - Why it matters!Sven Bernhardt
 

La actualidad más candente (20)

Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services Architecture
 
Designing APIs with OpenAPI Spec
Designing APIs with OpenAPI SpecDesigning APIs with OpenAPI Spec
Designing APIs with OpenAPI Spec
 
API for Beginners
API for BeginnersAPI for Beginners
API for Beginners
 
API Governance and GitOps in Hybrid Integration Platform (MuleSoft)
API Governance and GitOps in Hybrid Integration Platform (MuleSoft)API Governance and GitOps in Hybrid Integration Platform (MuleSoft)
API Governance and GitOps in Hybrid Integration Platform (MuleSoft)
 
Document your rest api using swagger - Devoxx 2015
Document your rest api using swagger - Devoxx 2015Document your rest api using swagger - Devoxx 2015
Document your rest api using swagger - Devoxx 2015
 
Introducing OpenAPI Version 3.1
Introducing OpenAPI Version 3.1Introducing OpenAPI Version 3.1
Introducing OpenAPI Version 3.1
 
Architecting an Enterprise API Management Strategy
Architecting an Enterprise API Management StrategyArchitecting an Enterprise API Management Strategy
Architecting an Enterprise API Management Strategy
 
Introduction to REST - API
Introduction to REST - APIIntroduction to REST - API
Introduction to REST - API
 
How Secure Are Your APIs?
How Secure Are Your APIs?How Secure Are Your APIs?
How Secure Are Your APIs?
 
API Presentation
API PresentationAPI Presentation
API Presentation
 
Apigee Demo: API Platform Overview
Apigee Demo: API Platform OverviewApigee Demo: API Platform Overview
Apigee Demo: API Platform Overview
 
API Management in Digital Transformation
API Management in Digital TransformationAPI Management in Digital Transformation
API Management in Digital Transformation
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
The Architecture of an API Platform
The Architecture of an API PlatformThe Architecture of an API Platform
The Architecture of an API Platform
 
Open API and API Management - Introduction and Comparison of Products: TIBCO ...
Open API and API Management - Introduction and Comparison of Products: TIBCO ...Open API and API Management - Introduction and Comparison of Products: TIBCO ...
Open API and API Management - Introduction and Comparison of Products: TIBCO ...
 
Enforcing Your Organization's API Design Standards with SwaggerHub
Enforcing Your Organization's API Design Standards with SwaggerHubEnforcing Your Organization's API Design Standards with SwaggerHub
Enforcing Your Organization's API Design Standards with SwaggerHub
 
Api-First service design
Api-First service designApi-First service design
Api-First service design
 
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
 
API Management - Why it matters!
API Management - Why it matters!API Management - Why it matters!
API Management - Why it matters!
 
Apigee Products Overview
Apigee Products OverviewApigee Products Overview
Apigee Products Overview
 

Similar a Schema-First API Design

API workshop: Introduction to APIs (TC Camp)
API workshop: Introduction to APIs (TC Camp)API workshop: Introduction to APIs (TC Camp)
API workshop: Introduction to APIs (TC Camp)Tom Johnson
 
Practices and tools for building better APIs
Practices and tools for building better APIsPractices and tools for building better APIs
Practices and tools for building better APIsNLJUG
 
Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)Peter Hendriks
 
API Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIsAPI Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIsTom Johnson
 
APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...
APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...
APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...Restlet
 
API Services: Building State-of-the-Art APIs
API Services: Building State-of-the-Art APIsAPI Services: Building State-of-the-Art APIs
API Services: Building State-of-the-Art APIsApigee | Google Cloud
 
The ultimate api checklist by Blendr.io
The ultimate api checklist by Blendr.ioThe ultimate api checklist by Blendr.io
The ultimate api checklist by Blendr.ioBlendr.io
 
API Versioning for Zero Downtime | Devoxx Belgium 2017
API Versioning for Zero Downtime | Devoxx Belgium 2017API Versioning for Zero Downtime | Devoxx Belgium 2017
API Versioning for Zero Downtime | Devoxx Belgium 2017Patrice Krakow
 
Creating a mule project with raml and api
Creating a mule project with raml and apiCreating a mule project with raml and api
Creating a mule project with raml and apiBhargav Ranjit
 
IBM Integration Bus and REST APIs - Sanjay Nagchowdhury
IBM Integration Bus and REST APIs - Sanjay NagchowdhuryIBM Integration Bus and REST APIs - Sanjay Nagchowdhury
IBM Integration Bus and REST APIs - Sanjay NagchowdhuryKaren Broughton-Mabbitt
 
API workshop by AWS and 3scale
API workshop by AWS and 3scaleAPI workshop by AWS and 3scale
API workshop by AWS and 3scale3scale
 
Api clarity webinar
Api clarity webinarApi clarity webinar
Api clarity webinarLibbySchulze
 
The anypoint platform for API's
The anypoint platform for API'sThe anypoint platform for API's
The anypoint platform for API'sAchyuta Lakshmi
 
A Journey from API Versioning to Canary Release | APIDays Zurich 2017
A Journey from API Versioning to Canary Release | APIDays Zurich 2017A Journey from API Versioning to Canary Release | APIDays Zurich 2017
A Journey from API Versioning to Canary Release | APIDays Zurich 2017Patrice Krakow
 
Play Your API with MuleSoft API Notebook
Play Your API with MuleSoft API NotebookPlay Your API with MuleSoft API Notebook
Play Your API with MuleSoft API NotebookRakesh Kumar Jha
 
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Tom Johnson
 
API Documentation.pptx
API Documentation.pptxAPI Documentation.pptx
API Documentation.pptxRahulCR31
 

Similar a Schema-First API Design (20)

API workshop: Introduction to APIs (TC Camp)
API workshop: Introduction to APIs (TC Camp)API workshop: Introduction to APIs (TC Camp)
API workshop: Introduction to APIs (TC Camp)
 
Practices and tools for building better APIs
Practices and tools for building better APIsPractices and tools for building better APIs
Practices and tools for building better APIs
 
Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)
 
Crafting APIs
Crafting APIsCrafting APIs
Crafting APIs
 
API Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIsAPI Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIs
 
APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...
APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...
APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...
 
API Services: Building State-of-the-Art APIs
API Services: Building State-of-the-Art APIsAPI Services: Building State-of-the-Art APIs
API Services: Building State-of-the-Art APIs
 
The ultimate api checklist by Blendr.io
The ultimate api checklist by Blendr.ioThe ultimate api checklist by Blendr.io
The ultimate api checklist by Blendr.io
 
Api tools overview
Api tools overviewApi tools overview
Api tools overview
 
API Versioning for Zero Downtime | Devoxx Belgium 2017
API Versioning for Zero Downtime | Devoxx Belgium 2017API Versioning for Zero Downtime | Devoxx Belgium 2017
API Versioning for Zero Downtime | Devoxx Belgium 2017
 
Creating a mule project with raml and api
Creating a mule project with raml and apiCreating a mule project with raml and api
Creating a mule project with raml and api
 
IBM Integration Bus and REST APIs - Sanjay Nagchowdhury
IBM Integration Bus and REST APIs - Sanjay NagchowdhuryIBM Integration Bus and REST APIs - Sanjay Nagchowdhury
IBM Integration Bus and REST APIs - Sanjay Nagchowdhury
 
API workshop by AWS and 3scale
API workshop by AWS and 3scaleAPI workshop by AWS and 3scale
API workshop by AWS and 3scale
 
Api Testing.pdf
Api Testing.pdfApi Testing.pdf
Api Testing.pdf
 
Api clarity webinar
Api clarity webinarApi clarity webinar
Api clarity webinar
 
The anypoint platform for API's
The anypoint platform for API'sThe anypoint platform for API's
The anypoint platform for API's
 
A Journey from API Versioning to Canary Release | APIDays Zurich 2017
A Journey from API Versioning to Canary Release | APIDays Zurich 2017A Journey from API Versioning to Canary Release | APIDays Zurich 2017
A Journey from API Versioning to Canary Release | APIDays Zurich 2017
 
Play Your API with MuleSoft API Notebook
Play Your API with MuleSoft API NotebookPlay Your API with MuleSoft API Notebook
Play Your API with MuleSoft API Notebook
 
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
Survival Strategies for API Documentation: Presentation to Southwestern Ontar...
 
API Documentation.pptx
API Documentation.pptxAPI Documentation.pptx
API Documentation.pptx
 

Más de Yos Riady

Brief introduction to Serverless (2018)
Brief introduction to Serverless (2018)Brief introduction to Serverless (2018)
Brief introduction to Serverless (2018)Yos Riady
 
Type Checking in Javascript with Flow
Type Checking in Javascript with FlowType Checking in Javascript with Flow
Type Checking in Javascript with FlowYos Riady
 
Writing Domain Specific Languages with JSON Schema
Writing Domain Specific Languages with JSON SchemaWriting Domain Specific Languages with JSON Schema
Writing Domain Specific Languages with JSON SchemaYos Riady
 
GraphQL in an Age of REST
GraphQL in an Age of RESTGraphQL in an Age of REST
GraphQL in an Age of RESTYos Riady
 
Python List Comprehensions
Python List ComprehensionsPython List Comprehensions
Python List ComprehensionsYos Riady
 
Ruby on Rails Workshop
Ruby on Rails WorkshopRuby on Rails Workshop
Ruby on Rails WorkshopYos Riady
 
Online Payments and You
Online Payments and YouOnline Payments and You
Online Payments and YouYos Riady
 
Entity Component Systems
Entity Component SystemsEntity Component Systems
Entity Component SystemsYos Riady
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to ReactYos Riady
 
Intro to Web Map APIs
Intro to Web Map APIsIntro to Web Map APIs
Intro to Web Map APIsYos Riady
 

Más de Yos Riady (10)

Brief introduction to Serverless (2018)
Brief introduction to Serverless (2018)Brief introduction to Serverless (2018)
Brief introduction to Serverless (2018)
 
Type Checking in Javascript with Flow
Type Checking in Javascript with FlowType Checking in Javascript with Flow
Type Checking in Javascript with Flow
 
Writing Domain Specific Languages with JSON Schema
Writing Domain Specific Languages with JSON SchemaWriting Domain Specific Languages with JSON Schema
Writing Domain Specific Languages with JSON Schema
 
GraphQL in an Age of REST
GraphQL in an Age of RESTGraphQL in an Age of REST
GraphQL in an Age of REST
 
Python List Comprehensions
Python List ComprehensionsPython List Comprehensions
Python List Comprehensions
 
Ruby on Rails Workshop
Ruby on Rails WorkshopRuby on Rails Workshop
Ruby on Rails Workshop
 
Online Payments and You
Online Payments and YouOnline Payments and You
Online Payments and You
 
Entity Component Systems
Entity Component SystemsEntity Component Systems
Entity Component Systems
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to React
 
Intro to Web Map APIs
Intro to Web Map APIsIntro to Web Map APIs
Intro to Web Map APIs
 

Último

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 

Último (20)

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 

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: support@example.com 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.
  • 21.
  • 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