Design First API's with RAML and SoapUI

5,309 views
5,005 views

Published on

Daniel Feist, Architect @ Mulesoft
Matti Hjelm, SoapUI Product Manager @ SmartBear

In this workshop we'll develop a real-world API together using RAML to define the interface and SoapUI to simulate and test the interface and API consumer experience before even thinking about the implementation. In doing this we'll cover the powerful design-first features of RAML as well as the tooling available to facilite this approach. We’ll also cover the mocking and prototyping features of SoapUI. Finally we'll implement, deploy and test our new API in a production environment.

Published in: Technology
2 Comments
10 Likes
Statistics
Notes
No Downloads
Views
Total views
5,309
On SlideShare
0
From Embeds
0
Number of Embeds
249
Actions
Shares
0
Downloads
102
Comments
2
Likes
10
Embeds 0
No embeds

No notes for slide

Design First API's with RAML and SoapUI

  1. 1. API First Development with RAML and SoapUI Daniel Feist @dfeist Principal Architect, MuleSoft Matti Hjelm Product Manager, SmartBear
  2. 2. Me?
  3. 3. API Testing and Mocking
  4. 4. Use Case
  5. 5. •  (Fictitious) Global Shipping & Logistics Company •  Shipping via Truck/Ship/Air from Warehouses •  Two tiers of customers: •  Pay as you go (small medium business) •  Premium Customers (e.g. Amazon, Macy’s, etc.) •  Mythical looking for new ways to increase revenue •  Currently use FTP integration for partner enablement Mythical Logistics Inc
  6. 6. •  New revenue channel - Perishable Inventory •  Unused shipping capacity •  Last minute deals •  Low rates for premium subscription customers •  Operational efficiency •  API Initiative •  Build new API for perishable inventory quote/shipment •  Leverage existing RateFinder Service for quote •  Enable mobile apps with new API New Business Opportunity 6
  7. 7. New ‘Business Shipping API’ /quote RateFinder API Perishable Inventory Application /shipment Business Shipping APIConsumer apps API Implementation Premium
  8. 8. API Development Lifecycle
  9. 9. API Development Lifecycle Test   Build   Publish   Operate  Design   Engage  Mock  
  10. 10. Design
  11. 11. •  The Client Application? •  The Service Implementation? So, what should we ‘Design’ first?
  12. 12. ü  Interface is most important part of your API ü where consumers touch you ü your front door, your lobby, your façade ü your brand ü Good API helps achieve Adoption ü  Enables parallel development. ü  Allows you to start testing early. Neither! The API interface..
  13. 13. Model your API.. •  design for them your users •  iterate quickly •  model cleanly and consistently •  gather feedback •  test! Validate Capture Feedback API à APX
  14. 14. Collaborate on API Design Business Shipping API Tom Shafii Product Manager, API’s Mythical Logistics Inc. Jason Hall Senior Developer Mythical Logistics Inc.
  15. 15. Design: The Contract
  16. 16. WSDL? **
  17. 17. What then? ** Format Strength Reusable Patterns Sponsor WADL (XML) Swagger (JSON) IODocs (JSON) RestDoc (JSON) API Blueprint (Markdown) RAML (YAML) RestDoc
  18. 18. WADL
  19. 19. Swagger
  20. 20. IOdocs
  21. 21. API Blueprint
  22. 22. Design:
  23. 23. RAML A new open spec for RESTful APIs that's as clean and as structured as REST itself RESTful API Modeling Language the RAML Workgroup: raml.org
  24. 24. RAML: Clean & Structured.
  25. 25. RAML: Reuse resource type schema trait
  26. 26. Covers Full HTTP optional version in baseUri template URIs query parameters headers (on request and response) response per status code example (and schema) per media type
  27. 27. Patterns: Resource Types externalizable inheritance pull in traits parametrize
  28. 28. Patterns: Method-level traits mix-ins
  29. 29. Patterns: body schemas or just use good ol' form data: XML schema JSON schema examples
  30. 30. Patterns: security schemes username/password; cleartext or use digest end user allows app to access their data better to put token in header, not query the OAuth multi-step dance
  31. 31. Design Demo
  32. 32. Demo
  33. 33. Collaborate on API Design Business Shipping API Tom Shafii Product Manager, API’s Mythical Logistics Inc. Jason Hall Senior Developer Mythical Logistics Inc.
  34. 34. Mock
  35. 35. Why Mock? ü  To try it out! ü Minimal investment ü Find design issues early ü  Provide early access to API for feedback. ü  Start building clients
  36. 36. Demo - Mock
  37. 37. Prototype / Iterate Business Shipping API Tom Shafii Product Manager, API’s Mythical Logistics Inc. Jason Hall Senior Developer Mythical Logistics Inc. Ruby Mobile App Developer, Amazon Inc. Feedback New Reqs. Mock
  38. 38. Test
  39. 39. Manual Testing
  40. 40. Testing for Real.. ü  Scenario based testing ü  Automated ü  Reusable (design, dev, prod) ü  Test Performance
  41. 41. Demo - Test
  42. 42. First, Test your Mock API Business Shipping API Jason Hall Senior Developer Mythical Logistics Inc. Mock API Tests
  43. 43. •  SoapUI testing the API •  Import RAML •  Mock the API •  Test the API (Mocked) •  Improve the API •  Add cancel (verb DELETE) •  Use the mock from client (Android) Demo
  44. 44. Testing actually improves Design MockDesign Test
  45. 45. Build
  46. 46. Demo
  47. 47. Test your API in Development Business Shipping API Jason Hall Senior Developer Mythical Logistics Inc. API Implementation API Tests
  48. 48. Publish
  49. 49. Demo - Publish
  50. 50. Test your API in Production Business Shipping API API Implementation Ruby Rails Mobile App Developer, Amazon Inc. Invoke API
  51. 51. Operate
  52. 52. •  Contract Enforcement •  Security •  Analytics •  Monetization API Management
  53. 53. Demo - Management
  54. 54. Monitoring: Quality in production •  Monitoring •  Synthetic vs RUM (real user monitoring) •  Use Alertsite •  Samma testsuite i design, utveckling, pre prod test and post deploy •  Root cause APM tools •  Debug API in production
  55. 55. Demo - Monitoring
  56. 56. API Operation Business Shipping API API Implementation Invoke API
  57. 57. Engage
  58. 58. •  Having a delightful API! •  Prototyping tools •  Interactive Console •  Notebook •  Social Tools •  Rate, discuss •  Provide feedback •  Forum Engage Developers
  59. 59. Demo – API Portal
  60. 60. Demo - API Notebook
  61. 61. API Development Lifecycle Test   Build   Publish   Operate  Design   Engage  Mock  
  62. 62. Thank You!

×