Skip to content

Conversation

@vincentvis
Copy link

Before the stricter typing we used this like this:

$errorObject->addSource('entity', [
     'type' => $this->type,
     'id'   => $this->id,
 ]);

And relied in the processing of validation errors on being able to get error.source.entity.id
This change forces us to use a string as the entity identifier, which would either make us lose the type or id context, or require extra work on the receiving end to split the string value of $type . ' ' . $id given as a string.

Before the stricter typing we used this like this:
```php
$errorObject->addSource('entity', [
     'type' => $this->type,
     'id'   => $this->id,
 ]);
```
@vincentvis
Copy link
Author

Closing my own PR after reading the JSON:API spec

@vincentvis vincentvis closed this Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant