This document discusses how Swagger can be used to develop APIs faster. It describes what Swagger is, provides an example Swagger YAML file, and discusses how code can be generated from Swagger specifications. It also introduces Swagger Inflector, which uses the Swagger specification as the single source of truth to automatically route controllers, map models, and generate sample data when controllers are not implemented. The document encourages rethinking the DRY principle and maintaining the API specification as the central source.
2. What is Swagger?
• A simple, structured way to describe your
API
• Methods, Resources, Parameters, media
types
• Everything your consumers need to know
to consume your API
4. Let’s talk Codegen
• We’ve seen code generators before…
– WSDL2Java
– WADL2Java
– W*2*???
– ODataWhere are
all the
projects!???
Too
complicated!
Hard to
customize!
8. Workflow
• Client SDKs regenerated, imported with
contract change
– Common practice for F/E & mobile devs
• Server updated by regeneration
– In-place with maven plugin
– “merged” with download from online
• …
10. Introducing Swagger Inflector
• Use Swagger as the Source of Truth for
the API
– Automatically route to controllers
– Automatically map models
– Generate Sample Data when controllers not
implemented
https://github.com/swagger-api/swagger-inflector
12. Swagger Connected
• Swagger is FOSS
• Specification + Tools at http://swagger.io
• All source at https://github.com/swagger-api
• Real-time support at irc.freenode.net
#swagger