Your SlideShare is downloading. ×
Fastest to Mobile with Scalatra + Swagger
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Fastest to Mobile with Scalatra + Swagger

495
views

Published on

Presentation by Tony Tam on using the Scalatra micro web framework with native support for Swagger. This gives the fastest possible server-to-mobile integration with Scala

Presentation by Tony Tam on using the Scalatra micro web framework with native support for Swagger. This gives the fastest possible server-to-mobile integration with Scala

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
495
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Fastest to Mobile! With Scalatra + Swagger! ! @fehguy!
  • 2. Swagger Philosophy!
  • 3. Swagger Philosophy! Service documentation sucks! ! typically(
  • 4. Swagger Philosophy! •  Communicating is too much work! – Users don’t want to write YOUR SDK! – If you’re good at Ruby, you suck at GO! •  Consumers need a contract! – Service logic doesn’t belong in the SDK! •  Services are plumbing! – We shouldn’t all be plumbers! – Business logic is your business!
  • 5. Swagger Philosophy! •  Solved by machine-readable, discoverable API contract! •  Should speed up, not slow down development process! •  External services/proxies not required!
  • 6. What is Swagger?! •  An interface to your service! – Described in JSON! •  It is a contract to your service! •  Enables “bigotry-free” restful design with emphasis on getting things done! – Many ways to delete a Pet!
  • 7. How does it work?! •  Discoverable at runtime, not compile-time! •  It’s just JSON! •  No server integration required! – You can describe an API that’s not even yours! – Deploy anywhere! Put it on github!! – Swagger is JUST a way to describe an API!
  • 8. But Why?! •  Machine-readable contract! –  Description of *everything* the server can do! –  Server-controlled documentation! –  Server/language/platform/deployment agnostic! •  Documentation, code generation, client generation! –  Like Headers for C, Interfaces for Java!
  • 9. How do you add Swagger?! •  Static Files! – Manually crafted JSON! •  Heuristics! – Traffic inspection! •  Code inspection! – Code comments, static annotations! •  Runtime generation! It’s just JSON!!
  • 10. Swagger + Scalatra! •  Scalatra is a Lightweight, High- performance Micro web framework! •  Extremely clean DSL! •  First-class swagger support! •  http://www.scalatra.org!
  • 11. Scalatra as a REST API!
  • 12. Scalatra as a REST API! Content&Type& Nego,a,on&via& json4s&
  • 13. Scalatra as a REST API! Content&Type& Nego,a,on&via& json4s& Simple&Rou,ng&
  • 14. Scalatra as a REST API! Content&Type& Nego,a,on&via& json4s& Simple&Rou,ng& Param& Extrac,on&
  • 15. Scalatra as a REST API!
  • 16. Swagger + Scalatra! •  Without Swagger Support! •  With Swagger Support!
  • 17. Swagger + Scalatra! •  Auto- generation of swagger JSON!!
  • 18. Swagger + Scalatra! •  No ugly Java annotations!!
  • 19. Swagger + Scalatra! •  Model descriptions!
  • 20. Swagger + Scalatra! •  Model descriptions! Type&safety& has&its& benefits!&
  • 21. Swagger UI for “free”!
  • 22. Swagger UI for “free”! Your&Boss& can&try&your& API!&
  • 23. Going Moble! •  If you are good at scala, you probably suck at Objective C!
  • 24. Swagger + Mustache! •  Typesafe conversion between swagger to Objective C!
  • 25. Swagger + Mustache! •  Typesafe conversion between swagger to Objective C! Templates& you&can& Tweak!&
  • 26. Mustache Templates!
  • 27. Mustache Templates!
  • 28. Sharing Libraries with Love!
  • 29. Other Mobile SDKs! •  Android + Java!
  • 30. Other Mobile SDKs! •  Android + Java!
  • 31. Other Mobile SDKs! •  Javascript!
  • 32. Scalatra + Swagger! •  Simplest DSL for REST APIs in Scala! •  Minimal dependencies! •  Tested at scale! •  Not “hello world”! •  Apache 2.0 everything!
  • 33. https://helloreverb.com/swagger/! ! Questions?!