jsonapi-rust
jsonapi-rust copied to clipboard
Nested relations' relations become attributes instead of relations
Instead of creating something like this:
"data": {
"type": "inventory-purchase-order",
"attributes": {
"purchase-order-lines": [
{
"parts": [],
"price": "99.99",
"purchase-order": null,
"purchased-quantity": 1,
"sku": {
"assembly-configurations": [],
"description": null,
"id": "21",
"kind": "case",
"manufacturer": null,
"reorder-quantity": 0,
"serialized": false,
"sku": "RCV-TEST-0001"
}
}
],
},
"relationships": {
"purchase_order_lines": {
"data": [
{
"type": "inventory-purchase-order-line",
}
]
}
}
},
It should create this:
"data": {
"type": "inventory-purchase-order",
"relationships": {
"purchase-order-lines": {
"data": [
{
"meta": {
"attributes": {
"price": "99.99",
"sku-id": "21",
}
}
}
]
}
}
}
@mmstick do you have an example of some code that you used to generate this? Happy to explore this issue if you can help provide an example that demonstrates how you arrived at the invalid document.