order = %Order{
id: 10,
first_name: "User",
last_name: "Example",
}
orders = [order]
%Representer.Item{
rel: "https://example.com/rels/order",
href: "https://example.com/orders/1",
data: order,
links: [
%Representer.Link{
rel: "self",
href: "https://example.com/orders/1"
},
],
}
%Representer.Collection{
href: "https://example.com/orders",
name: "orders",
items: Enum.map(orders, &item/1),
links: [
%Representer.Link{
rel: "self",
href: "https://example.com/orders"
},
%Representer.Link{
rel: "up",
href: "https://example.com/"
}
]
}