Problem/Motivation
Trying to access tokens over JSON:API at /jsonapi/token_custom/custom results in an error:
'Parameter "entity" for route "jsonapi.token_custom--custom.individual" must match "[^/]++" ("" given) to generate a corresponding URL.'
This appears to be because custom token entities do not have a UUID.
Steps to reproduce
Proposed resolution
Add a UUID base field to the entity type.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork token_custom-3567563
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
longwaveThe MR adds the UUID base field to the entity, an update hook that sets UUIDs on existing entities, and a test to prove that JSON:API works.
Disclaimer: this MR was partially written by Claude Code.
Comment #4
longwaveThe update hook doesn't work properly, will fix that soon.
Comment #5
longwaveClosing in favour of #3426280: Prepare the module to work with EntityShare and JSON:API which already does this.
The update hook here runs into a core bug: #3567733: Adding a UUID to an existing entity type uses the wrong table