Everybody loves Swagger
Everybody loves Swagger
Nice to meet you
Massimo Crippa
Integration Architect at Codit
 BizTalk D/I
 Api Management
massimo.crippa@codit.eu
codit.eu/blog
@mas_que_crippa
linkedin.com/in/massimocrippa
Agenda
Why APIs are trending
➔ Open Innovation and New
Markets. Enable firms to use internal as well as
external ideas and find new market paths
➔ Consume, Switch or Upgrade
Seamlessly. Drive both the API Consumer and
Provider towards a continuous improvement of quality
➔ Build on Partner Capabilities
➔ Increase Brand Presence
➔ Generate New Revenue Streams
➔ Enable Composite Enterprise
Approach where business functionalities become
small configurable blocks.
➔ Reduce time-to-market
➔ Fueled by mobile, cloud, big data
& IoT
The successful API
➔ Easy to consume (TTFSC, TTFHW)
➔ Understand the use, prevent the misuse (Data formats, authentication, error codes)
➔ Upgrade seamlessly
➔ Getting started, Multi language code samples, SDKs (DevEx)
The documentation is CRUCIAL
What is Swagger?
Edit the API specification in
YAML to produce the JSON
Editor
Layout, describe and
document your API
Specification
A dependency-free collection
of HTML / JS / CSS that
consumes the swagger.json
UI
Consume the swagger.json to
create client and server code
Code-Gen
The specification
Definition language to describe and document RESTful API
➔ Metadata
➔ info, basepath, consumes, produces, etc..
➔ Controllers (paths)
➔ Operations, HTTP verbs, status codes, schema refs
➔ Objects Definition (definitions)
➔ Parameters (e.g. skip)
➔ Responses
➔ Security (e.g. oauth)
The editors
API Specification-First
➔ Swagger Editor
➔ editor.swagger.io
➔ Editor + swagger.js
➔ apistudio.io
➔ Restlet studio (cross-format editor)
➔ studio.restlet.com
The Swagger UI
It’s a dependency-free collection of HTML / JavaScript / CSS
➔ List of APIs
➔ description, version, base path
➔ Drill-down to the operations
➔ http methods
➔ Description, Parameters, Types
➔ Try-out the API
Tools
Community-driven tools
Whole world of open source tools out there!
Swashbuckle
.NET library to auto-generate the swagger.json
➔ ApiExplorer to keep implementation and documentation in-sync
➔ Auto-generate as much as possible + extensibility points
➔ Discoverable (one endpoint per version)
➔ Minimal impact to your API
➔ Shashbuckle.core
➔ Shashbuckle
➔ Version 5.2.1
➔ vNext 6.0.0 beta7
Integrations
API Management
API Management
Azure API Management service
➔ Produces swagger 2.0
➔ Consumes 1.2 and 2.0
Sentinet by Nevatech
➔ Introduced with the version 4.6 (October 2015)
➔ Produces swagger 2.0
➔ Consumes 2.0
Takeaways
➔ A good developer experience is crucial to build a successful API
➔ Swagger is the de facto standard to describe modern APIs
➔ Swashbuckle: discoverable swagger.json + UI for devs
➔ Large number of applications and services that consume swagger
References
➔ Swagger
http://swagger.io/
➔ Swashbuckle
https://github.com/domaindrivendev/Swashbuckle/
➔ Microsoft Azure API Management
http://azure.microsoft.com/en-us/services/api-management/
➔ Sentinet by Nevatech
http://www.nevatech.com/
Thank you!

Everybody loves Swagger (Massimo Crippa @ Integration Monday)

  • 1.
  • 2.
  • 3.
    Nice to meetyou Massimo Crippa Integration Architect at Codit  BizTalk D/I  Api Management massimo.crippa@codit.eu codit.eu/blog @mas_que_crippa linkedin.com/in/massimocrippa
  • 4.
  • 5.
    Why APIs aretrending ➔ Open Innovation and New Markets. Enable firms to use internal as well as external ideas and find new market paths ➔ Consume, Switch or Upgrade Seamlessly. Drive both the API Consumer and Provider towards a continuous improvement of quality ➔ Build on Partner Capabilities ➔ Increase Brand Presence ➔ Generate New Revenue Streams ➔ Enable Composite Enterprise Approach where business functionalities become small configurable blocks. ➔ Reduce time-to-market ➔ Fueled by mobile, cloud, big data & IoT
  • 6.
    The successful API ➔Easy to consume (TTFSC, TTFHW) ➔ Understand the use, prevent the misuse (Data formats, authentication, error codes) ➔ Upgrade seamlessly ➔ Getting started, Multi language code samples, SDKs (DevEx) The documentation is CRUCIAL
  • 7.
    What is Swagger? Editthe API specification in YAML to produce the JSON Editor Layout, describe and document your API Specification A dependency-free collection of HTML / JS / CSS that consumes the swagger.json UI Consume the swagger.json to create client and server code Code-Gen
  • 8.
    The specification Definition languageto describe and document RESTful API ➔ Metadata ➔ info, basepath, consumes, produces, etc.. ➔ Controllers (paths) ➔ Operations, HTTP verbs, status codes, schema refs ➔ Objects Definition (definitions) ➔ Parameters (e.g. skip) ➔ Responses ➔ Security (e.g. oauth)
  • 9.
    The editors API Specification-First ➔Swagger Editor ➔ editor.swagger.io ➔ Editor + swagger.js ➔ apistudio.io ➔ Restlet studio (cross-format editor) ➔ studio.restlet.com
  • 10.
    The Swagger UI It’sa dependency-free collection of HTML / JavaScript / CSS ➔ List of APIs ➔ description, version, base path ➔ Drill-down to the operations ➔ http methods ➔ Description, Parameters, Types ➔ Try-out the API
  • 11.
  • 12.
    Community-driven tools Whole worldof open source tools out there!
  • 13.
    Swashbuckle .NET library toauto-generate the swagger.json ➔ ApiExplorer to keep implementation and documentation in-sync ➔ Auto-generate as much as possible + extensibility points ➔ Discoverable (one endpoint per version) ➔ Minimal impact to your API ➔ Shashbuckle.core ➔ Shashbuckle ➔ Version 5.2.1 ➔ vNext 6.0.0 beta7
  • 14.
  • 15.
  • 16.
    API Management Azure APIManagement service ➔ Produces swagger 2.0 ➔ Consumes 1.2 and 2.0 Sentinet by Nevatech ➔ Introduced with the version 4.6 (October 2015) ➔ Produces swagger 2.0 ➔ Consumes 2.0
  • 17.
    Takeaways ➔ A gooddeveloper experience is crucial to build a successful API ➔ Swagger is the de facto standard to describe modern APIs ➔ Swashbuckle: discoverable swagger.json + UI for devs ➔ Large number of applications and services that consume swagger
  • 18.
    References ➔ Swagger http://swagger.io/ ➔ Swashbuckle https://github.com/domaindrivendev/Swashbuckle/ ➔Microsoft Azure API Management http://azure.microsoft.com/en-us/services/api-management/ ➔ Sentinet by Nevatech http://www.nevatech.com/
  • 19.