Is it ok for embedded to be used in sub properties? For example, this resource is for a work time card for a week. Rather than just show all shifts as a single embedded list on the time card, group them by day and provide some summary data for each day.
{
"_links": {
"self": {
"href": "/timecard/2"
}
},
"shiftsSummary": {
"numberShiftsWorked": 9,
"hoursWorked": 45.5,
"hoursPaid": 48.5,
"numberOfMissingPunches": 0
},
"numberOfEdits": 14,
"startDate": "2016-07-26T00:00",
"endDate": "2016-08-01T00:00",
"days": [
{
"date": "2016-07-26",
"totalHoursWorked": 8.0,
"_embedded": {
"shifts": [
{
"date": "2016-07-26T00:00",
"startDateTime": "2016-07-26T09:00",
"endDateTime": "2016-07-26T10:00",
"paidHours": 6.0,
"_links": {
"self": {
"href": "/shift/123"
}
}
}
]
}
},
{
"date": "2016-07-27",
"totalHoursWorked": 8.0,
"_embedded": {
"shifts": [
{
"date": "2016-07-27T00:00",
"startDateTime": "2016-07-27T09:00",
"endDateTime": "2016-07-27T10:00",
"paidHours": 4.0,
"_links": {
"self": {
"href": "/shift/124"
}
}
},
{
"date": "2016-07-27T00:00",
"startDateTime": "2016-07-27T16:00",
"endDateTime": "2016-07-27T20:00",
"paidHours": 4.0,
"_links": {
"self": {
"href": "/shift/125"
}
}
}
]
}
}
]
}
--
You received this message because you are subscribed to the Google Groups "API Craft" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-craft+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/api-craft.
For more options, visit https://groups.google.com/d/optout.