SlideShare a Scribd company logo
Zen and the Art of REST API
documentation
1
µCon London - Nov, 2015
About me
2
Steve Judd - Lead Consultant
OpenCredo - an Open Source software consultancy
3
Agenda
Completeness
URI
Request/Response objects
Status codes used
Headers
Consistency
Extra features
Client & Server mocking
Testing
Code generation
4
WHY
5
WHICH
Swagger
RAML
API Blueprint
6
BACKGROUND
Swagger RAML API Blueprint
Spec format YAML, JSON YAML Markdown
Backed by Reverb, SmartBear
MuleSoft, Intuit,
Cisco…
Apiary
First appeared 2011 2013 2013
Commercial
offering
Yes (via swagger.io) No Yes (via apiary.io)
Popularity
Github: 393
StackOverflow: ~2900
GitHub: 140
StackOverflow: ~260
GitHub: 58
StackOverflow: ~300
7
SPEC COMPARISON
Swagger RAML API Blueprint
REST modelling
All support: resources, methods, status codes, query, path &
header params
HATEOAS ✘ ✘ ✘
Authentication ✔ ✔ ✘
Versioning ✔ ✔ ✘
Example
representations ✔ ✔ ✔
8
TOOLING COMPARISON
Swagger RAML API Blueprint
Editor ✔✔ ✔✔ ✔
Interactive API
explorer ✔✔ ✔ ✔
Mocking tools ✔✔ ✔✔ ✔✔
Language support
Java, PHP, Node/JS,
Ruby, Clojure, C#, Scala,
Python, Go, .Net, Perl
Java, PHP, Node/JS,
Ruby, Python, .Net
Java, Node/JS, Ruby, .Net
Testing support ✔ ✔✔ ✔✔
Code generation ✔✔✔ ✔ ✘
Publishing tools ✔✔✔ ✔ ✔
9
The Editors...
10
Swagger Editor
11
API Designer (RAML)
12
Apiary (API Blueprint)
Swagger
swagger-test (Node.js)
assertj-swagger (Java/Maven)
RAML
abao (Node.js)
raml-tester (Java/Maven)
API Blueprint
Dredd (Ruby, Python, Node.js, PHP)
13
Contract verification
Take 1 top-down
API spec (written in
Swagger)
And 1 bottom-up
API spec
(produced using
SpringFox or JAX-
RS Swagger)
And assert that they
are equal
assertj-swagger
14
•abao uses any
examples defined
in the API spec
file as test data.
•You can also
define extra test
data.
•Run abao against
a running instance
of your
implementation
abao
15
Swagger
swagger2Markup: Spec -> AsciiDoc or
Markdown
various Spec -> HTML projects
RAML
raml2html: Spec -> HTML
raml2md: Spec -> Markdown
API Blueprint
Aglio: Spec -> HTML
16
Publishing
17
Summary
Swagger & RAML mostly equal and
ahead of API Blueprint
Swagger seems more popular
Swagger probably has more
support for Java projects
RAML probably has more support
for Node.js projects
Either is a good choice
Thank you and any questions?
http://www.opencredo.com/blog
@OpenCredo
@cyberbliss
Websites and GitHub repos
My Spring REST repo containing examples: https://github.com/cyberbliss/springboot-rest-example
Swagger site: http://swagger.io/
Swagger spec: https://github.com/swagger-api/swagger-spec
Swagger Editor: https://github.com/swagger-api/swagger-editor
Online Swagger Editor: http://editor.swagger.io/
Swagger-Test: https://github.com/earldouglas/swagger-test
assertj-swagger: https://github.com/RobWin/assertj-swagger
Swagger2Markup: https://github.com/Swagger2Markup/swagger2markup-maven-plugin
RAML site: http://raml.org/
RAML spec: https://github.com/raml-org/raml-spec
RAML Editor: https://github.com/mulesoft/api-designer
abao tester: https://github.com/cybertk/abao/
RAML tester: https://github.com/nidi3/raml-tester
raml2html: https://github.com/kevinrenskers/raml2html
raml2Markdown: https://github.com/kevinrenskers/raml2md
API Blueprint site: https://apiblueprint.org/
API Blueprint spec: https://github.com/apiaryio/api-blueprint
API Blueprint tester: https://github.com/apiaryio/dredd
API Blueprint to HTML: https://github.com/danielgtaylor/aglio
Online Mock server generator: http://getsandbox.com
Code generation as a service: https://apimatic.io/

More Related Content

PPTX
Java 8 New features
PPTX
Java 8 concurrency abstractions
PDF
An Introduction to Play 2 Framework
PDF
Software Design Patterns in Laravel by Phill Sparks
PDF
Overview of Java EE
PDF
Javantura v4 - FreeMarker in Spring web - Marin Kalapać
PDF
Building Scalable Applications with Laravel
PPTX
Eclipse Day India 2015 - Java 8 Overview
Java 8 New features
Java 8 concurrency abstractions
An Introduction to Play 2 Framework
Software Design Patterns in Laravel by Phill Sparks
Overview of Java EE
Javantura v4 - FreeMarker in Spring web - Marin Kalapać
Building Scalable Applications with Laravel
Eclipse Day India 2015 - Java 8 Overview

What's hot (20)

PPTX
Lambda Behave - Java 8's Testing Framework
PPTX
Frisby Api automation
PPTX
Laravel overview
PDF
2015 Java update and roadmap, JUG sevilla
PPTX
Polyglot Mule Transformers
PPTX
Laravel ppt
PDF
Web Development with Laravel 5
PDF
Laravel and CodeIgniter: pros & cons
PPTX
Repository design pattern in laravel
PPT
Advanced java
 
ODP
Introduction to Scala Macros
PPTX
Building Apis in Scala with Playframework2
PDF
Grape(Ruby on Rails)
PPTX
Laravel Tutorial PPT
PDF
Building a chatbot – step by step
PDF
Laravel
PPTX
Building a REST Service in minutes with Spring Boot
PDF
Laravel - The PHP Framework for Web Artisans
PDF
Testing Alfresco extensions
Lambda Behave - Java 8's Testing Framework
Frisby Api automation
Laravel overview
2015 Java update and roadmap, JUG sevilla
Polyglot Mule Transformers
Laravel ppt
Web Development with Laravel 5
Laravel and CodeIgniter: pros & cons
Repository design pattern in laravel
Advanced java
 
Introduction to Scala Macros
Building Apis in Scala with Playframework2
Grape(Ruby on Rails)
Laravel Tutorial PPT
Building a chatbot – step by step
Laravel
Building a REST Service in minutes with Spring Boot
Laravel - The PHP Framework for Web Artisans
Testing Alfresco extensions
Ad

Similar to Zen and the Art of REST API documentation - MuCon London 2015 (20)

PPTX
Another API-Blueprint, RAML and Swagger Comparison
PPTX
API Description Languages: Which is the Right One for Me?
PPTX
API Description Languages: Which is the Right One for Me?
PPTX
API Athens Meetup - API standards 25-6-2014
PPTX
API Athens Meetup - API standards 25-6-2014
PDF
API Description Languages: Which Is The Right One For Me?
PPTX
Swagger - Making REST APIs friendlier
PDF
API Description Languages
PDF
API Description Languages
PPTX
2019-08-23 API contract testing with Dredd
PDF
Swagger: Restful documentation that won't put you to sleep
PDF
Swagger 2.0: Latest and Greatest
PDF
Let your REST API talk @java2days
PDF
Swagger code motion talk
PDF
Swagger - Make your REST APIs accessible - Victor Trakhtenberg
PPTX
Tools and techniques for APIs
PPTX
Rest API with Swagger and NodeJS
PPTX
Scaling with swagger
PPTX
Love your API with Swagger (Gluecon lightning talk)
PPTX
Swagger - make your API accessible
Another API-Blueprint, RAML and Swagger Comparison
API Description Languages: Which is the Right One for Me?
API Description Languages: Which is the Right One for Me?
API Athens Meetup - API standards 25-6-2014
API Athens Meetup - API standards 25-6-2014
API Description Languages: Which Is The Right One For Me?
Swagger - Making REST APIs friendlier
API Description Languages
API Description Languages
2019-08-23 API contract testing with Dredd
Swagger: Restful documentation that won't put you to sleep
Swagger 2.0: Latest and Greatest
Let your REST API talk @java2days
Swagger code motion talk
Swagger - Make your REST APIs accessible - Victor Trakhtenberg
Tools and techniques for APIs
Rest API with Swagger and NodeJS
Scaling with swagger
Love your API with Swagger (Gluecon lightning talk)
Swagger - make your API accessible
Ad

Recently uploaded (20)

DOCX
Unit-3 cyber security network security of internet system
PPTX
durere- in cancer tu ttresjjnklj gfrrjnrs mhugyfrd
PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
PPTX
artificial intelligence overview of it and more
PDF
LABUAN4D EXCLUSIVE SERVER STAR GAMING ASIA NO.1
PPTX
Introduction to Information and Communication Technology
PDF
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
PDF
Paper PDF World Game (s) Great Redesign.pdf
PPTX
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
PPTX
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PPTX
CSharp_Syntax_Basics.pptxxxxxxxxxxxxxxxxxxxxxxxxxxxx
PDF
Sims 4 Historia para lo sims 4 para jugar
PDF
The Internet -By the Numbers, Sri Lanka Edition
PDF
WebRTC in SignalWire - troubleshooting media negotiation
PDF
Triggering QUIC, presented by Geoff Huston at IETF 123
PPTX
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
PDF
Behind the Smile Unmasking Ken Childs and the Quiet Trail of Deceit Left in H...
PPTX
Introuction about WHO-FIC in ICD-10.pptx
PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
Unit-3 cyber security network security of internet system
durere- in cancer tu ttresjjnklj gfrrjnrs mhugyfrd
Decoding a Decade: 10 Years of Applied CTI Discipline
artificial intelligence overview of it and more
LABUAN4D EXCLUSIVE SERVER STAR GAMING ASIA NO.1
Introduction to Information and Communication Technology
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
Paper PDF World Game (s) Great Redesign.pdf
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
CSharp_Syntax_Basics.pptxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Sims 4 Historia para lo sims 4 para jugar
The Internet -By the Numbers, Sri Lanka Edition
WebRTC in SignalWire - troubleshooting media negotiation
Triggering QUIC, presented by Geoff Huston at IETF 123
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
Behind the Smile Unmasking Ken Childs and the Quiet Trail of Deceit Left in H...
Introuction about WHO-FIC in ICD-10.pptx
522797556-Unit-2-Temperature-measurement-1-1.pptx

Zen and the Art of REST API documentation - MuCon London 2015

  • 1. Zen and the Art of REST API documentation 1 µCon London - Nov, 2015
  • 2. About me 2 Steve Judd - Lead Consultant OpenCredo - an Open Source software consultancy
  • 4. Completeness URI Request/Response objects Status codes used Headers Consistency Extra features Client & Server mocking Testing Code generation 4 WHY
  • 6. 6 BACKGROUND Swagger RAML API Blueprint Spec format YAML, JSON YAML Markdown Backed by Reverb, SmartBear MuleSoft, Intuit, Cisco… Apiary First appeared 2011 2013 2013 Commercial offering Yes (via swagger.io) No Yes (via apiary.io) Popularity Github: 393 StackOverflow: ~2900 GitHub: 140 StackOverflow: ~260 GitHub: 58 StackOverflow: ~300
  • 7. 7 SPEC COMPARISON Swagger RAML API Blueprint REST modelling All support: resources, methods, status codes, query, path & header params HATEOAS ✘ ✘ ✘ Authentication ✔ ✔ ✘ Versioning ✔ ✔ ✘ Example representations ✔ ✔ ✔
  • 8. 8 TOOLING COMPARISON Swagger RAML API Blueprint Editor ✔✔ ✔✔ ✔ Interactive API explorer ✔✔ ✔ ✔ Mocking tools ✔✔ ✔✔ ✔✔ Language support Java, PHP, Node/JS, Ruby, Clojure, C#, Scala, Python, Go, .Net, Perl Java, PHP, Node/JS, Ruby, Python, .Net Java, Node/JS, Ruby, .Net Testing support ✔ ✔✔ ✔✔ Code generation ✔✔✔ ✔ ✘ Publishing tools ✔✔✔ ✔ ✔
  • 13. Swagger swagger-test (Node.js) assertj-swagger (Java/Maven) RAML abao (Node.js) raml-tester (Java/Maven) API Blueprint Dredd (Ruby, Python, Node.js, PHP) 13 Contract verification
  • 14. Take 1 top-down API spec (written in Swagger) And 1 bottom-up API spec (produced using SpringFox or JAX- RS Swagger) And assert that they are equal assertj-swagger 14
  • 15. •abao uses any examples defined in the API spec file as test data. •You can also define extra test data. •Run abao against a running instance of your implementation abao 15
  • 16. Swagger swagger2Markup: Spec -> AsciiDoc or Markdown various Spec -> HTML projects RAML raml2html: Spec -> HTML raml2md: Spec -> Markdown API Blueprint Aglio: Spec -> HTML 16 Publishing
  • 17. 17 Summary Swagger & RAML mostly equal and ahead of API Blueprint Swagger seems more popular Swagger probably has more support for Java projects RAML probably has more support for Node.js projects Either is a good choice
  • 18. Thank you and any questions? http://www.opencredo.com/blog @OpenCredo @cyberbliss
  • 19. Websites and GitHub repos My Spring REST repo containing examples: https://github.com/cyberbliss/springboot-rest-example Swagger site: http://swagger.io/ Swagger spec: https://github.com/swagger-api/swagger-spec Swagger Editor: https://github.com/swagger-api/swagger-editor Online Swagger Editor: http://editor.swagger.io/ Swagger-Test: https://github.com/earldouglas/swagger-test assertj-swagger: https://github.com/RobWin/assertj-swagger Swagger2Markup: https://github.com/Swagger2Markup/swagger2markup-maven-plugin RAML site: http://raml.org/ RAML spec: https://github.com/raml-org/raml-spec RAML Editor: https://github.com/mulesoft/api-designer abao tester: https://github.com/cybertk/abao/ RAML tester: https://github.com/nidi3/raml-tester raml2html: https://github.com/kevinrenskers/raml2html raml2Markdown: https://github.com/kevinrenskers/raml2md API Blueprint site: https://apiblueprint.org/ API Blueprint spec: https://github.com/apiaryio/api-blueprint API Blueprint tester: https://github.com/apiaryio/dredd API Blueprint to HTML: https://github.com/danielgtaylor/aglio Online Mock server generator: http://getsandbox.com Code generation as a service: https://apimatic.io/