Skip to content

How to remove ToOne relationship? #74

Closed
@bertramakers

Description

@bertramakers

I'm trying to remove a ToOne relationship from a resource by sending a PATCH request to the resource with the ToOne relationship like this:

PATCH /api/v2/clusters/17

{
    "data": {
        "type": "clusters",
        "id": "17",
        "relationships": {
            "teamLead": {
                "data": null
            }
        }
    }
}

This results in a TypeError with the following message: obyz\JsonApiServer\Schema\Field\Relationship::findResourceForIdentifier(): Argument #1 ($identifier) must be of type array, null given, called in /var/www/vendor/tobyz/json-api-server/src/Schema/Field/ToOne.php on line 59

Is this a bug, or should I remove the ToOne relationship in a different way?

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