Skip to content

Instantly share code, notes, and snippets.

@trevmex
Created May 1, 2014 01:16
Show Gist options
  • Save trevmex/b0d310a8943d980194d2 to your computer and use it in GitHub Desktop.
Save trevmex/b0d310a8943d980194d2 to your computer and use it in GitHub Desktop.
An example of HAL JSON with Schema.org Metadata
{
"_type": "http://schema.org/QuantitativeValue/ProcessableOrders",
"_links": {
"self": { "href": "/orders" },
"curies": [{ "name": "ea", "href": "http://example.com/docs/rels/{rel}", "templated": true }],
"next": { "href": "/orders?page=2" },
"ea:find": {
"href": "/orders{?id}",
"templated": true
},
"ea:admin": [{
"href": "/admins/2",
"title": "Fred"
}, {
"href": "/admins/5",
"title": "Kate"
}]
},
"value/currentlyProcessing": 14,
"value/shippedToday": 20,
"_embedded": {
"ea:order": [{
"_type": "http://schema.org/Order",
"_links": {
"self": { "href": "/orders/123" },
"ea:basket": { "href": "/baskets/98712" },
"ea:customer": { "href": "/customers/7809" }
},
"price": 30.00,
"priceCurrency": "USD",
"orderStatus": {
"_type": "http://schema.org/OrderDelivered",
"_links": {
"self": { "href": "/orders/123" }
}
}
}, {
"_type": "http://schema.org/Order",
"_links": {
"self": { "href": "/orders/124" },
"ea:basket": { "href": "/baskets/97213" },
"ea:customer": { "href": "/customers/12369" }
},
"price": 20.00,
"priceCurrency": "USD",
"orderStatus": {
"_type": "http://schema.org/OrderProcessing",
"_links": {
"self": { "href": "/orders/124" }
}
}
}]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment