Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Putting Hypermedia Back in REST
with JAX-RS
sebastian daschner
@DaschnerS
sebastian daschner
● Java developer / architect / consultant
● JAX-RS Expert Group member
● Java Champion
● con...
@DaschnerS
workshops / training
● workshops in Munich
● workshops in Oslo / Norway (TBA)
● virtually on demand
@DaschnerS
“REST” APIs in real-world projects
@DaschnerS
“REST” APIs in real-world projects
POST /doSomeAction
request
<someActionRequest>
<param>12345</param>
</someAc...
@DaschnerS
“REST” APIs in real-world projects
POST /getFoobarInformation
request
<foobar>
<id>12345</id>
</foobar>
respons...
@DaschnerS
Resources
@DaschnerS
“REST” APIs in real-world projects
GET /users
response
<users>
<user>
<id>12345</id>
<name>Duke</name>
<motto>J...
@DaschnerS
Semantic HTTP
@DaschnerS
“REST” APIs in real-world projects
POST /users
request
<user>
<name>Duke</name>
<motto>JAX-RS rocks!</motto>
</...
@DaschnerS
Enter Hypermedia
@DaschnerS
Enter Hypermedia
GET /users
response
<users>
<user>
<name>Duke</name>
<motto>JAX-RS rocks!</motto>
<link rel="s...
@DaschnerS
Enter Hypermedia
GET /books/12345
response
{
"name": "Java",
// + author, availability, price
"_links": {
"self...
@DaschnerS
Enter Hypermedia
...
"actions": [
{
"name": "add-to-cart",
"method": "POST",
"href": "/shopping_cart",
"type": ...
@DaschnerS
Hypermedia formats
● HAL
● Collections+JSON
● Siren
● JSON Schema
● JSON-LD & Hydra
● ...
Thanks for your attention!
sebastian-daschner.com
twitter.com/DaschnerS
github.com/sdaschner
Upcoming SlideShare
Loading in …5
×

Putting Hypermedia Back in REST with JAX-RS

1,883 views

Published on

Apresentação de Sebastian Daschner para o 27º encontro PT.JUG.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Putting Hypermedia Back in REST with JAX-RS

  1. 1. Putting Hypermedia Back in REST with JAX-RS sebastian daschner
  2. 2. @DaschnerS sebastian daschner ● Java developer / architect / consultant ● JAX-RS Expert Group member ● Java Champion ● conference speaker
  3. 3. @DaschnerS workshops / training ● workshops in Munich ● workshops in Oslo / Norway (TBA) ● virtually on demand
  4. 4. @DaschnerS “REST” APIs in real-world projects
  5. 5. @DaschnerS “REST” APIs in real-world projects POST /doSomeAction request <someActionRequest> <param>12345</param> </someActionRequest> response <someActionResponse> <foo>bar</foo> ... </someActionResponse>
  6. 6. @DaschnerS “REST” APIs in real-world projects POST /getFoobarInformation request <foobar> <id>12345</id> </foobar> response <information> <foo>bar</foo> ... </information>
  7. 7. @DaschnerS Resources
  8. 8. @DaschnerS “REST” APIs in real-world projects GET /users response <users> <user> <id>12345</id> <name>Duke</name> <motto>JAX-RS rocks!</motto> </user> ... </users>
  9. 9. @DaschnerS Semantic HTTP
  10. 10. @DaschnerS “REST” APIs in real-world projects POST /users request <user> <name>Duke</name> <motto>JAX-RS rocks!</motto> </user> response 201 Created Location: /users/12345
  11. 11. @DaschnerS Enter Hypermedia
  12. 12. @DaschnerS Enter Hypermedia GET /users response <users> <user> <name>Duke</name> <motto>JAX-RS rocks!</motto> <link rel="self" href="/users/1234"/> </user> </users
  13. 13. @DaschnerS Enter Hypermedia GET /books/12345 response { "name": "Java", // + author, availability, price "_links": { "self": "/books/12345", "add-to-cart": "/shopping_cart" } }
  14. 14. @DaschnerS Enter Hypermedia ... "actions": [ { "name": "add-to-cart", "method": "POST", "href": "/shopping_cart", "type": "application/json", "fields": [ { "name": "id", "type": "text" }, { "name": "quantity", "type": "number" } ] } ]
  15. 15. @DaschnerS Hypermedia formats ● HAL ● Collections+JSON ● Siren ● JSON Schema ● JSON-LD & Hydra ● ...
  16. 16. Thanks for your attention! sebastian-daschner.com twitter.com/DaschnerS github.com/sdaschner

×