20
Response Deserialisation by Swagger with HAL https:// doc.co/u18YLp

EMOCON 2015 - HAL with Swagger

  • View
    420

  • Download
    0

Embed Size (px)

Citation preview

Page 1: EMOCON 2015 - HAL with Swagger

Response Deserialisationby Swagger with HAL

https://doc.co/u18YLp

Page 2: EMOCON 2015 - HAL with Swagger

Justin Yoo• Development Consultant at Kloud Solutions• Microsoft MVP• http://aliencube.org• http://devkimchi.com• @justinchronicle

Page 3: EMOCON 2015 - HAL with Swagger

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

Page 4: EMOCON 2015 - HAL with Swagger

Agenda• HAL (Hypertext Application Language)• HAL Demo• Swagger• Swagger Demo• AutoRest• AutoRest Demo• Q&A

Page 5: EMOCON 2015 - HAL with Swagger

HAL

Page 6: EMOCON 2015 - HAL with Swagger

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

Page 7: EMOCON 2015 - HAL with Swagger

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…

Page 8: EMOCON 2015 - HAL with Swagger

Sample Code

Page 10: EMOCON 2015 - HAL with Swagger

Swagger

Page 11: EMOCON 2015 - HAL with 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

Page 12: EMOCON 2015 - HAL with Swagger

Swagger Implementations• Java• Springfox

• JavaScript• Swagger Parser

• C#• Swashbuckle• AutoRest

• And more…• http://swagger.io/open-source-integrations

Page 13: EMOCON 2015 - HAL with Swagger

Swagger Sample Screen

Page 14: EMOCON 2015 - HAL with Swagger

Swagger.json

Page 16: EMOCON 2015 - HAL with Swagger

AutoRest

Page 17: EMOCON 2015 - HAL with Swagger

What is AutoRest?• Backed by Microsoft• Generating client libraries from JSON schema generated by Swagger• Supporting client libraries• C#• Java• JavaScript• Ruby

Page 19: EMOCON 2015 - HAL with Swagger

Q & A