Problem/Motivation
The title for document schemas concerning multiple resource types duplicates the title of the last resource type instead of showing all the resource type titles.
Steps to reproduce
Navigate to the JSON:API schema endpoint for a relationship having multiple possible entity/bundles that could be related. In farmOS that looks like `/api/asset/animal/resource/relationships/location/related/schema` but this should be reproducible on any Drupal install where there is a relationship which isn't constrained to a single bundle - and where multiple bundles for the related entity type exist.
Proposed resolution
Fix the array slice.
Remaining tasks
Review/Test patch
User interface changes
N/A
API changes
Text of schema document title changes.
Data model changes
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3322227-0.patch | 697 bytes | symbioquine |
| 2022_11_17_json_api_schema_title_issue.png | 84.73 KB | symbioquine |
Issue fork jsonapi_schema-3322227
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 #2
symbioquine commentedComment #3
m.stentaConfirmed this issue. It happens when there are greater than 2 allowed bundles in an entity reference field.
I created Page, Blog, and Article node types, and added an entity reference field to Articles called
test_entity_referencethat allows referencing any of them. The expectedtitleon/api/node/article/resource/relationships/test_entity_reference/related/schemashould beArticle content item, Blog content item, and Page content item, but instead it isPage content item, and Page content item.I will open a MR with a test for this and @symbioquine's fix.
Comment #5
m.stentaComment #6
m.stentaComment #8
m.stenta