Complete the code to define the main HAL JSON object with a _links section.
{
"_links": [1]
}The _links section in HAL is a JSON object mapping relation names to link objects. The correct format is an object with a self key containing an href key.
Complete the code to add an embedded resource named 'orders' with an empty array.
{
"_embedded": {
"[1]": []
}
}In HAL, embedded resources are grouped under _embedded. The key is the resource name, here orders.
Fix the error in the HAL link object by completing the href value correctly.
{
"_links": {
"self": {"href": "[1]"}
}
}The href value should be a valid URI or path starting with a slash for relative paths. /orders/123 is correct.
Fill both blanks to create a HAL resource with a self link and an embedded orders array.
{
"_links": {
"[1]": {"href": "/orders"}
},
"_embedded": {
"[2]": []
}
}The _links section needs a self link. The embedded resource name is orders.
Fill all three blanks to create a HAL resource with a self link, embedded orders, and a property 'count' with value 5.
{
"_links": {
"[1]": {"href": "/orders"}
},
"_embedded": {
"[2]": []
},
"[3]": 5
}The _links section needs a self link. The embedded resource is orders. The property count holds the number 5.