SlideShare une entreprise Scribd logo
1  sur  37
Télécharger pour lire hors ligne
Self-Documenting APIs
@skwp
@reverbdotcom
What Makes a
Good API?
Discoverable
Self Documenting
Standardized
Discoverability
Discoverability
What can I do with it?
If the engine of application
state (and hence the API) is
not being driven by
hypertext, then it cannot be
RESTful and cannot be a
REST API. Period.
http://martinfowler.com/articles/richardsonMaturityModel.html
Hypermedia as the Engine of Application State
HATEOAS
What Happens When I

GET reverb.com/api?
What Happens When I

GET yahoo.com?
curl https://reverb.com/api
GET product._links.buy
Evolvability
Self-Documenting
Self-Documenting
How can I do what I want to do?
Minimize
Documentation Drift
Generate Docs, Clients, even Servers from Code
Standardized
Standardized
How is it similar to other APIs?
Simplicity Increases

Likelihood of Adoption
Fewer Constructs is
Simpler
Siren • jsonapi.org • HAL
Siren • jsonapi.org • HAL
Siren • jsonapi.org • HAL
Winner: HAL
http://stateless.co/hal_specification.html
BONUS - Baked into Roar
Discoverable
✓HATEOAS
✓HAL Links
✓Grape+Roar
Self Documenting
✓Swagger
✓Grape-Swagger
✓Swagger-UI
Standardized
✓Swagger
✓HAL
✓REST
Resources
http://swagger.io/
https://github.com/swagger-api/swagger-spec
http://api.opensupporter.org/hb2/browser.html#/api/v1
http://stateless.co/hal_specification.html
https://github.com/swagger-api/swagger-ui
http://roy.gbiv.com/untangled/2008/rest-apis-must-be-
hypertext-driven
@skwp @reverbdotcom
https://github.com/swagger-api/swagger-codegen

Contenu connexe

Similaire à Building Self Documenting REST APIs

Practical guide to building public APIs
Practical guide to building public APIsPractical guide to building public APIs
Practical guide to building public APIsReda Hmeid MBCS
 
Making Sense of Hypermedia APIs – Hype or Reality?
Making Sense of Hypermedia APIs – Hype or Reality?Making Sense of Hypermedia APIs – Hype or Reality?
Making Sense of Hypermedia APIs – Hype or Reality?Akana
 
REST: The Most Misunderstood Software Architecture Ever
REST: The Most Misunderstood Software Architecture EverREST: The Most Misunderstood Software Architecture Ever
REST: The Most Misunderstood Software Architecture EverMartín Soto
 
Building REST APIs that don't suck for modern day SPAs
Building REST APIs that don't suck for modern day SPAsBuilding REST APIs that don't suck for modern day SPAs
Building REST APIs that don't suck for modern day SPAsAbati Adewale
 
Apigility – Lightning Fast API Development - OSSCamp 2014
Apigility – Lightning Fast API Development - OSSCamp 2014 Apigility – Lightning Fast API Development - OSSCamp 2014
Apigility – Lightning Fast API Development - OSSCamp 2014 OSSCube
 
API Documentation.pptx
API Documentation.pptxAPI Documentation.pptx
API Documentation.pptxRahulCR31
 
API Documentation.pptx
API Documentation.pptxAPI Documentation.pptx
API Documentation.pptxRahulCR31
 
A Practical Guide to Automating End-to-End API Testing
A Practical Guide to Automating End-to-End API TestingA Practical Guide to Automating End-to-End API Testing
A Practical Guide to Automating End-to-End API TestingpCloudy
 
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
 
What’s a REST API and why should I care?
What’s a REST API and why should I care?What’s a REST API and why should I care?
What’s a REST API and why should I care?topher1kenobe
 
Rest api best practices – comprehensive handbook
Rest api best practices – comprehensive handbookRest api best practices – comprehensive handbook
Rest api best practices – comprehensive handbookKaty Slemon
 
Alfresco Process Services REST API - Alfresco DevCon 2018
 Alfresco Process Services REST API - Alfresco DevCon 2018 Alfresco Process Services REST API - Alfresco DevCon 2018
Alfresco Process Services REST API - Alfresco DevCon 2018Dennis Koch
 
Web Clients for Ruby and What they should be in the future
Web Clients for Ruby and What they should be in the futureWeb Clients for Ruby and What they should be in the future
Web Clients for Ruby and What they should be in the futureToru Kawamura
 
RefCard API Architecture Strategy
RefCard API Architecture StrategyRefCard API Architecture Strategy
RefCard API Architecture StrategyOCTO Technology
 
Understanding API Architectures: Web API vs. Minimal API – An In-Depth Compar...
Understanding API Architectures: Web API vs. Minimal API – An In-Depth Compar...Understanding API Architectures: Web API vs. Minimal API – An In-Depth Compar...
Understanding API Architectures: Web API vs. Minimal API – An In-Depth Compar...Polyxer Systems
 

Similaire à Building Self Documenting REST APIs (20)

Crafting APIs
Crafting APIsCrafting APIs
Crafting APIs
 
Practical guide to building public APIs
Practical guide to building public APIsPractical guide to building public APIs
Practical guide to building public APIs
 
Making Sense of Hypermedia APIs – Hype or Reality?
Making Sense of Hypermedia APIs – Hype or Reality?Making Sense of Hypermedia APIs – Hype or Reality?
Making Sense of Hypermedia APIs – Hype or Reality?
 
REST: The Most Misunderstood Software Architecture Ever
REST: The Most Misunderstood Software Architecture EverREST: The Most Misunderstood Software Architecture Ever
REST: The Most Misunderstood Software Architecture Ever
 
Api
ApiApi
Api
 
Building REST APIs that don't suck for modern day SPAs
Building REST APIs that don't suck for modern day SPAsBuilding REST APIs that don't suck for modern day SPAs
Building REST APIs that don't suck for modern day SPAs
 
API Conference 2021
API Conference 2021API Conference 2021
API Conference 2021
 
Apigility – Lightning Fast API Development - OSSCamp 2014
Apigility – Lightning Fast API Development - OSSCamp 2014 Apigility – Lightning Fast API Development - OSSCamp 2014
Apigility – Lightning Fast API Development - OSSCamp 2014
 
API Documentation.pptx
API Documentation.pptxAPI Documentation.pptx
API Documentation.pptx
 
API Documentation.pptx
API Documentation.pptxAPI Documentation.pptx
API Documentation.pptx
 
A Practical Guide to Automating End-to-End API Testing
A Practical Guide to Automating End-to-End API TestingA Practical Guide to Automating End-to-End API Testing
A Practical Guide to Automating End-to-End API Testing
 
Web API with ASP.NET MVC by Software development company in india
Web API with ASP.NET  MVC  by Software development company in indiaWeb API with ASP.NET  MVC  by Software development company in india
Web API with ASP.NET MVC by Software development company in india
 
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
 
What’s a REST API and why should I care?
What’s a REST API and why should I care?What’s a REST API and why should I care?
What’s a REST API and why should I care?
 
Rest api best practices – comprehensive handbook
Rest api best practices – comprehensive handbookRest api best practices – comprehensive handbook
Rest api best practices – comprehensive handbook
 
Alfresco Process Services REST API - Alfresco DevCon 2018
 Alfresco Process Services REST API - Alfresco DevCon 2018 Alfresco Process Services REST API - Alfresco DevCon 2018
Alfresco Process Services REST API - Alfresco DevCon 2018
 
Web Clients for Ruby and What they should be in the future
Web Clients for Ruby and What they should be in the futureWeb Clients for Ruby and What they should be in the future
Web Clients for Ruby and What they should be in the future
 
Apitesting.pptx
Apitesting.pptxApitesting.pptx
Apitesting.pptx
 
RefCard API Architecture Strategy
RefCard API Architecture StrategyRefCard API Architecture Strategy
RefCard API Architecture Strategy
 
Understanding API Architectures: Web API vs. Minimal API – An In-Depth Compar...
Understanding API Architectures: Web API vs. Minimal API – An In-Depth Compar...Understanding API Architectures: Web API vs. Minimal API – An In-Depth Compar...
Understanding API Architectures: Web API vs. Minimal API – An In-Depth Compar...
 

Plus de Yan Pritzker

Bitcoin not Blockchain
Bitcoin not BlockchainBitcoin not Blockchain
Bitcoin not BlockchainYan Pritzker
 
CTO - Startup to Growth
CTO - Startup to GrowthCTO - Startup to Growth
CTO - Startup to GrowthYan Pritzker
 
Outsource Everything
Outsource EverythingOutsource Everything
Outsource EverythingYan Pritzker
 
Domain Driven Rails
Domain Driven RailsDomain Driven Rails
Domain Driven RailsYan Pritzker
 
Building Services on and off Rails
Building Services on and off RailsBuilding Services on and off Rails
Building Services on and off RailsYan Pritzker
 
Virtualization and Cloud Computing with Elastic Server On Demand
Virtualization and Cloud Computing with Elastic Server On DemandVirtualization and Cloud Computing with Elastic Server On Demand
Virtualization and Cloud Computing with Elastic Server On DemandYan Pritzker
 

Plus de Yan Pritzker (11)

Bitcoin not Blockchain
Bitcoin not BlockchainBitcoin not Blockchain
Bitcoin not Blockchain
 
CTO - Startup to Growth
CTO - Startup to GrowthCTO - Startup to Growth
CTO - Startup to Growth
 
Outsource Everything
Outsource EverythingOutsource Everything
Outsource Everything
 
Domain Driven Rails
Domain Driven RailsDomain Driven Rails
Domain Driven Rails
 
Pasted image-3237
Pasted image-3237Pasted image-3237
Pasted image-3237
 
Pasted image-1795
Pasted image-1795Pasted image-1795
Pasted image-1795
 
Pasted image-3237
Pasted image-3237Pasted image-3237
Pasted image-3237
 
Pasted image-1795
Pasted image-1795Pasted image-1795
Pasted image-1795
 
Pasted image-1706
Pasted image-1706Pasted image-1706
Pasted image-1706
 
Building Services on and off Rails
Building Services on and off RailsBuilding Services on and off Rails
Building Services on and off Rails
 
Virtualization and Cloud Computing with Elastic Server On Demand
Virtualization and Cloud Computing with Elastic Server On DemandVirtualization and Cloud Computing with Elastic Server On Demand
Virtualization and Cloud Computing with Elastic Server On Demand
 

Building Self Documenting REST APIs