-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Due to https://github.com/undabot/json-api-symfony/blob/v2.2.2/src/Service/Resource/Validation/ResourceValidator.php#L91 I have to send all defined relationships when creating a resource.
Let's say for example that I have user and posts resources and a one to many relationship is defined between user and posts. Sending this payload (which is perfectly valid according to the spec) results in a validation error (which shouldn't happen).
{
"data": {
"type": "users",
"attributes": {
"foo": "bar"
}
}
}{
"errors": [
{
"title": "This field is missing.",
"source": {
"pointer": "/data/relationships/posts"
}
}
]
}So I have to send this instead:
{
"data": {
"type": "users",
"attributes": {
"foo": "bar"
},
"relationships": {
"posts": {
"data": []
}
}
}
}Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working