SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Downloaden Sie, um offline zu lesen
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/

Weitere ähnliche Inhalte

Was ist angesagt?

Lambda Behave - Java 8's Testing Framework
Lambda Behave - Java 8's Testing FrameworkLambda Behave - Java 8's Testing Framework
Lambda Behave - Java 8's Testing Frameworksara stanford
 
2015 Java update and roadmap, JUG sevilla
2015  Java update and roadmap, JUG sevilla2015  Java update and roadmap, JUG sevilla
2015 Java update and roadmap, JUG sevillaTrisha Gee
 
Web Development with Laravel 5
Web Development with Laravel 5Web Development with Laravel 5
Web Development with Laravel 5Soheil Khodayari
 
Laravel and CodeIgniter: pros & cons
Laravel and CodeIgniter: pros & consLaravel and CodeIgniter: pros & cons
Laravel and CodeIgniter: pros & consElenorWisozk
 
Repository design pattern in laravel
Repository design pattern in laravelRepository design pattern in laravel
Repository design pattern in laravelSameer Poudel
 
Advanced java
Advanced java Advanced java
Advanced java NA
 
Introduction to Scala Macros
Introduction to Scala MacrosIntroduction to Scala Macros
Introduction to Scala MacrosKnoldus Inc.
 
Building Apis in Scala with Playframework2
Building Apis in Scala with Playframework2Building Apis in Scala with Playframework2
Building Apis in Scala with Playframework2Manish Pandit
 
Building a REST Service in minutes with Spring Boot
Building a REST Service in minutes with Spring BootBuilding a REST Service in minutes with Spring Boot
Building a REST Service in minutes with Spring BootOmri Spector
 
Laravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web ArtisansLaravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web ArtisansWindzoon Technologies
 
Testing Alfresco extensions
Testing Alfresco extensionsTesting Alfresco extensions
Testing Alfresco extensionsITD Systems
 

Was ist angesagt? (20)

Lambda Behave - Java 8's Testing Framework
Lambda Behave - Java 8's Testing FrameworkLambda Behave - Java 8's Testing Framework
Lambda Behave - Java 8's Testing Framework
 
Frisby Api automation
Frisby Api automationFrisby Api automation
Frisby Api automation
 
Laravel overview
Laravel overviewLaravel overview
Laravel overview
 
Java basics training 1
Java basics training 1Java basics training 1
Java basics training 1
 
2015 Java update and roadmap, JUG sevilla
2015  Java update and roadmap, JUG sevilla2015  Java update and roadmap, JUG sevilla
2015 Java update and roadmap, JUG sevilla
 
Polyglot Mule Transformers
Polyglot Mule TransformersPolyglot Mule Transformers
Polyglot Mule Transformers
 
Laravel ppt
Laravel pptLaravel ppt
Laravel ppt
 
Web Development with Laravel 5
Web Development with Laravel 5Web Development with Laravel 5
Web Development with Laravel 5
 
Laravel and CodeIgniter: pros & cons
Laravel and CodeIgniter: pros & consLaravel and CodeIgniter: pros & cons
Laravel and CodeIgniter: pros & cons
 
Repository design pattern in laravel
Repository design pattern in laravelRepository design pattern in laravel
Repository design pattern in laravel
 
Advanced java
Advanced java Advanced java
Advanced java
 
Introduction to Scala Macros
Introduction to Scala MacrosIntroduction to Scala Macros
Introduction to Scala Macros
 
Building Apis in Scala with Playframework2
Building Apis in Scala with Playframework2Building Apis in Scala with Playframework2
Building Apis in Scala with Playframework2
 
Grape(Ruby on Rails)
Grape(Ruby on Rails)Grape(Ruby on Rails)
Grape(Ruby on Rails)
 
Laravel Tutorial PPT
Laravel Tutorial PPTLaravel Tutorial PPT
Laravel Tutorial PPT
 
Building a chatbot – step by step
Building a chatbot – step by stepBuilding a chatbot – step by step
Building a chatbot – step by step
 
Laravel
LaravelLaravel
Laravel
 
Building a REST Service in minutes with Spring Boot
Building a REST Service in minutes with Spring BootBuilding a REST Service in minutes with Spring Boot
Building a REST Service in minutes with Spring Boot
 
Laravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web ArtisansLaravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web Artisans
 
Testing Alfresco extensions
Testing Alfresco extensionsTesting Alfresco extensions
Testing Alfresco extensions
 

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

Jcon 2017 How to use Swagger to develop REST applications
Jcon 2017 How to use Swagger to develop REST applicationsJcon 2017 How to use Swagger to develop REST applications
Jcon 2017 How to use Swagger to develop REST applicationsjohannes_fiala
 
Streamlining API with Swagger.io
Streamlining API with Swagger.ioStreamlining API with Swagger.io
Streamlining API with Swagger.ioVictor Augusteo
 
API Docs Made Right / RAML - Swagger rant
API Docs Made Right / RAML - Swagger rantAPI Docs Made Right / RAML - Swagger rant
API Docs Made Right / RAML - Swagger rantVladimir Shulyak
 
apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...
apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...
apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...apidays
 
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)GraphQL - A query language to empower your API consumers (NDC Sydney 2017)
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)Rob Crowley
 
Building REST APIs with Django
Building REST APIs with DjangoBuilding REST APIs with Django
Building REST APIs with DjangoByron Dover
 
PyCon Korea 2019 REST API Document Generation
PyCon Korea 2019 REST API Document GenerationPyCon Korea 2019 REST API Document Generation
PyCon Korea 2019 REST API Document Generation용선 이
 
Another API-Blueprint, RAML and Swagger Comparison
Another API-Blueprint, RAML and Swagger ComparisonAnother API-Blueprint, RAML and Swagger Comparison
Another API-Blueprint, RAML and Swagger ComparisonSmartBear
 
apidays LIVE Paris 2021 - Inside API delivery Pipeline, the checklist! - Fran...
apidays LIVE Paris 2021 - Inside API delivery Pipeline, the checklist! - Fran...apidays LIVE Paris 2021 - Inside API delivery Pipeline, the checklist! - Fran...
apidays LIVE Paris 2021 - Inside API delivery Pipeline, the checklist! - Fran...apidays
 
Implementing OpenAPI and GraphQL services with gRPC
Implementing OpenAPI and GraphQL services with gRPCImplementing OpenAPI and GraphQL services with gRPC
Implementing OpenAPI and GraphQL services with gRPCTim Burks
 
Developing Brilliant and Powerful APIs in Ruby & Python
Developing Brilliant and Powerful APIs in Ruby & PythonDeveloping Brilliant and Powerful APIs in Ruby & Python
Developing Brilliant and Powerful APIs in Ruby & PythonSmartBear
 
2019-08-23 API contract testing with Dredd
2019-08-23 API contract testing with Dredd2019-08-23 API contract testing with Dredd
2019-08-23 API contract testing with DreddRyan M Harrison
 
API Description Languages: Which Is The Right One For Me?
 API Description Languages: Which Is The Right One For Me?  API Description Languages: Which Is The Right One For Me?
API Description Languages: Which Is The Right One For Me? ProgrammableWeb
 
Seattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js WorkshopSeattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js WorkshopJimmy Guerrero
 
How easy (or hard) it is to monitor your graph ql service performance
How easy (or hard) it is to monitor your graph ql service performanceHow easy (or hard) it is to monitor your graph ql service performance
How easy (or hard) it is to monitor your graph ql service performanceLuca Mattia Ferrari
 
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...
Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...François-Guillaume Ribreau
 
Go swagger tutorial how to create golang api documentation using go swagger (1)
Go swagger tutorial how to create golang api documentation using go swagger (1)Go swagger tutorial how to create golang api documentation using go swagger (1)
Go swagger tutorial how to create golang api documentation using go swagger (1)Katy Slemon
 
Your API on Steroids
Your API on Steroids Your API on Steroids
Your API on Steroids QAware GmbH
 
Tutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHPTutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHPAndrew Rota
 

Ähnlich wie Zen and the Art of REST API documentation - MuCon London 2015 (20)

Jcon 2017 How to use Swagger to develop REST applications
Jcon 2017 How to use Swagger to develop REST applicationsJcon 2017 How to use Swagger to develop REST applications
Jcon 2017 How to use Swagger to develop REST applications
 
Streamlining API with Swagger.io
Streamlining API with Swagger.ioStreamlining API with Swagger.io
Streamlining API with Swagger.io
 
API Docs Made Right / RAML - Swagger rant
API Docs Made Right / RAML - Swagger rantAPI Docs Made Right / RAML - Swagger rant
API Docs Made Right / RAML - Swagger rant
 
apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...
apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...
apidays LIVE Hong Kong 2021 - GraphQL : Beyond APIs, graph your enterprise by...
 
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)GraphQL - A query language to empower your API consumers (NDC Sydney 2017)
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)
 
Building REST APIs with Django
Building REST APIs with DjangoBuilding REST APIs with Django
Building REST APIs with Django
 
PyCon Korea 2019 REST API Document Generation
PyCon Korea 2019 REST API Document GenerationPyCon Korea 2019 REST API Document Generation
PyCon Korea 2019 REST API Document Generation
 
Another API-Blueprint, RAML and Swagger Comparison
Another API-Blueprint, RAML and Swagger ComparisonAnother API-Blueprint, RAML and Swagger Comparison
Another API-Blueprint, RAML and Swagger Comparison
 
apidays LIVE Paris 2021 - Inside API delivery Pipeline, the checklist! - Fran...
apidays LIVE Paris 2021 - Inside API delivery Pipeline, the checklist! - Fran...apidays LIVE Paris 2021 - Inside API delivery Pipeline, the checklist! - Fran...
apidays LIVE Paris 2021 - Inside API delivery Pipeline, the checklist! - Fran...
 
Gohan
GohanGohan
Gohan
 
Implementing OpenAPI and GraphQL services with gRPC
Implementing OpenAPI and GraphQL services with gRPCImplementing OpenAPI and GraphQL services with gRPC
Implementing OpenAPI and GraphQL services with gRPC
 
Developing Brilliant and Powerful APIs in Ruby & Python
Developing Brilliant and Powerful APIs in Ruby & PythonDeveloping Brilliant and Powerful APIs in Ruby & Python
Developing Brilliant and Powerful APIs in Ruby & Python
 
2019-08-23 API contract testing with Dredd
2019-08-23 API contract testing with Dredd2019-08-23 API contract testing with Dredd
2019-08-23 API contract testing with Dredd
 
API Description Languages: Which Is The Right One For Me?
 API Description Languages: Which Is The Right One For Me?  API Description Languages: Which Is The Right One For Me?
API Description Languages: Which Is The Right One For Me?
 
Seattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js WorkshopSeattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js Workshop
 
How easy (or hard) it is to monitor your graph ql service performance
How easy (or hard) it is to monitor your graph ql service performanceHow easy (or hard) it is to monitor your graph ql service performance
How easy (or hard) it is to monitor your graph ql service performance
 
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...
Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...
 
Go swagger tutorial how to create golang api documentation using go swagger (1)
Go swagger tutorial how to create golang api documentation using go swagger (1)Go swagger tutorial how to create golang api documentation using go swagger (1)
Go swagger tutorial how to create golang api documentation using go swagger (1)
 
Your API on Steroids
Your API on Steroids Your API on Steroids
Your API on Steroids
 
Tutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHPTutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHP
 

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/