Skip to content

Nested relations' relations become attributes instead of relations #55

@mmstick

Description

@mmstick

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",
                        }
                    }
                }
            ]
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions