Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Building APIs with Node.js and Swagger


Published on

This talk started with a quick description of APIs and the importance of good documentation. We then introduced Swagger, talked about how/why it helps in solving this process. Finally, we talked about a number of Node.js tools we've built to help make API design, API development and better overall APIs using Node.js and Swagger.

Published in: Technology

Building APIs with Node.js and Swagger

  1. 1. Building APIs in Node.js with Swagger Jeremy Whitlock
  2. 2. What is an API?
  3. 3. An API is an “application programming interface”… the interface for interaction.
  4. 4. API APIs are Building Blocks
  5. 5. APIs in the Physical World
  6. 6. Input Contract APIs Define an Interaction Model
  7. 7. Output Contract APIs Define an Interaction Model
  8. 8. Without documentation… … how can you expect developers to get in?
  9. 9. What is Swagger?
  10. 10. Swagger is a specification to describe APIs.
  11. 11. Swagger emerges as an industry standard
  12. 12. Swagger Documents • Written in JSON or YAML • Clearly describe: –Available APIs –API input contract –API output contract –Required authn/authz –Success/Error responses –… • Extensible
  13. 13. It is much more than just Swagger-UI!
  14. 14. How Do People Use Swagger?
  15. 15. Swagger Mixing Swagger with Code
  16. 16. Swagger Mixing Swagger with Code Duplication
  17. 17. Code Without Swagger
  18. 18. Swagger-Driven APIs Swagger: Not just for documentation!
  19. 19. Swagger-Driven APIs Swagger Swagger Metadata Routing Security Request Validation Response Validation Business Logic
  20. 20. There is no wrong approach. Use what makes sense for you.
  21. 21. Swagger tooling for Node.js (and more)
  22. 22. > npm install swagger-tools
  23. 23. swagger-editor (
  24. 24. > npm install swagger
  25. 25. Announcing:
  26. 26. Write your spec and docs render live
  27. 27. Shareable spec and mock server
  28. 28. But it doesn't end there…
  29. 29. Thank you