Developing Faster with Swagger

13
Developing faster with Swagger Tony Tam @fehguy

Transcript of Developing Faster with Swagger

Page 1: Developing Faster with Swagger

Developing faster with Swagger

Tony Tam @fehguy

Page 2: Developing Faster with Swagger

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

Page 3: Developing Faster with Swagger

Swagger Example

YAML

ForHumans

Page 4: Developing Faster with Swagger

Let’s talk Codegen

•  We’ve seen code generators before… – WSDL2Java – WADL2Java – W*2*??? – OData Whereare

alltheprojects!???

Toocomplicated!

Hardtocustomize!

Page 5: Developing Faster with Swagger

Swagger’s got your Back (end)!

Page 6: Developing Faster with Swagger

And your Front!

Page 7: Developing Faster with Swagger

All your Plumbing by Swagger!

Page 8: Developing Faster with Swagger

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

•  …

Page 9: Developing Faster with Swagger

Plus…

•  Let’s rethink DRY Whatiseasierto

maintain???

Page 10: Developing Faster with Swagger

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

Page 11: Developing Faster with Swagger

Show me!

Introducing Swagger Inflector

Page 12: Developing Faster with Swagger

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

Page 13: Developing Faster with Swagger

Thank you!