Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Api Builder - Scala Up North 2017

sullis
July 21, 2017

Api Builder - Scala Up North 2017

July 21, 2017
Scala Up North
Vancouver BC
#scala #apibuilder #rest #canada

sullis

July 21, 2017
Tweet

More Decks by sullis

Other Decks in Technology

Transcript

  1. • software engineer • 21 years on the JVM •

    back office systems @ HBC About me
  2. • 2000: WSDL 1.0 (SOAP) • 2006: WADL (REST) •

    2011: Swagger (REST) • 2014: ApiDoc (REST) • 2017: ApiDoc rebranded to ApiBuilder
  3. "models": { "credit_card": { "fields": [ { "name": "guid", "type":

    "uuid" }, { "name": "user_guid", "type": "uuid" }, { "name": "type", "type": "credit_card_type" }, { "name": "issuer", "type": “string", “required": false }, { "name": "last_four", "type": "string" }, { "name": "expire_date", "type": "string" }, { "name": "billing_address", "type": "address" } ] } }
  4. "resources": { "credit_card": { "operations": [ { "method": "GET", "path":

    "/:guid", "description": "Get a credit card.", "responses": { "200": { "type": "credit_card" }, "404": { "type": “unit”, "description": "Card not found." } } } }
  5. • Rails app • JSP web framework • ~10 services

    (Java) • handcrafted Java clients • weak typing (java.util.HashMap) Gilt: 2009 => 2010
  6. • JSP’s • 100+ services (Java, Scala) • strongly typed

    client libraries • Gilt “Commons” library Gilt: 2011 => 2013
  7. • Gilt Commons library • 250+ services • binary coupling

    • dependency hell • ApiBuilder project started on Github Gilt: 2014
  8. Mitigating dependency hell • API design must be first class

    • backwards and forward compatibility • accurate documentation • generated client libraries
  9. • 350+ services • new services built with ApiBuilder +

    generated clients • Gilt Commons library is deprecated Gilt: 2015 => 2017
  10. Scala client generators • Http4s + Circe JSON • Ning

    AsyncHttpClient {1.8, 1.9} • Play WS {2.2, 2.3, 2.4, 2.5, 2.6}