Unleashing Hyperdrive

Unleashing Hyperdrive

Unleashing Hyperdrive, a Swift API client utilising Hypermedia and API Blueprint

D200a17dd269fd4001bacb11662dab4b?s=128

Kyle Fuller

April 17, 2015
Tweet

Transcript

  1. 2.
  2. 6.
  3. 7.
  4. 15.

    Ability to change implementation details 4 Change fields used in

    forms 4 Change validation of attributes in forms 4 Change URIs of resources (/polls/{id} -> / questions/{slug}) 4 Change HTTP methods (PUT -> PATCH) 4 Change the content-type
  5. 24.

    if let questions = representor.links["questions"] { // The API offered

    us a link to questions } else { // Gracefully handle when this feature is missing }
  6. 28.

    if let create = representor.transitions["create"] { // API supports creation

    } else { // Feature is missing // Let's not show the create button in our UI }
  7. 29.

    let attributes = [ "question": "Favourite language?", "choices": [ "Swift",

    "Ruby", "Python", ] ] hyperdrive.request(create, attributes) { }
  8. 31.
  9. 34.
  10. 35.
  11. 37.
  12. 40.