emocon 2015 - hal with swagger
Post on 14-Jan-2017
421 views
TRANSCRIPT
Response Deserialisationby Swagger with HAL
https://doc.co/u18YLp
Justin Yoo• Development Consultant at Kloud Solutions• Microsoft MVP• http://aliencube.org• http://devkimchi.com• @justinchronicle
Disclaimer• Contents in this slide:• Are ONLY my personal opinion• MAY be different from my company’s opinion
• Sample codes used in the demo:• CAN be used or distributed under the MIT licence• MAY contain defects• MAY NOT be suitable for production use
Agenda• HAL (Hypertext Application Language)• HAL Demo• Swagger• Swagger Demo• AutoRest• AutoRest Demo• Q&A
HAL
What is HAL?• Hypertext Application Language• Richardson Maturity Model• Layer 3: Hypermedia Control
• Returning resource with metadata• Metadata contains information
what to do next
http://martinfowler.com/articles/richardsonMaturityModel.html
HAL Implementations• IETF Draft• https://tools.ietf.org/html/draft-kelly-json-hal
• List of public hypermedia APIs using HAL• Amazon AppStream• Oxford University
• HAL libraries• Java, C#• PHP, Python, Ruby• JavaScript, Swift, Obj-C• etc…
Sample Code
HAL Demohttps://github.com/JakeGinnivan/WebApi.Halhttps://www.nuget.org/packages/WebApi.Hal
Swagger
What is Swagger?• http://swagger.io• Standard interface to REST APIs• Better discoverability• for humans• for machines
• Better understandability• without reading source codes
• Client SDK generation
Swagger Implementations• Java• Springfox
• JavaScript• Swagger Parser
• C#• Swashbuckle• AutoRest
• And more…• http://swagger.io/open-source-integrations
Swagger Sample Screen
Swagger.json
Swagger Demohttps://github.com/domaindrivendev/Swashbucklehttps://www.nuget.org/packages/Swashbuckle
AutoRest
What is AutoRest?• Backed by Microsoft• Generating client libraries from JSON schema generated by Swagger• Supporting client libraries• C#• Java• JavaScript• Ruby
AutoRest Demohttps://github.com/Azure/AutoResthttps://www.nuget.org/packages/AutoResthttps://www.nuget.org/packages/Microsoft.Rest.ClientRuntime
Q & A
Thank Youhttps://github.com/devkimchi/HAL-Swagger-Samplehttps://github.com/devkimchi/TypeScript-WebApi-Samplehttp://wp.me/p4VdUn-mr