Problem/Motivation
JSON:API has \Drupal\jsonapi\ResourceType\ResourceTypeBuildEvent
to allow fields to be aliased, fields to be disabled and resource types to be disabled. Those were the three first public PHP APIs for the jsonapi
module.
A logical next one would be to allow resource types to be aliased.
Related: @bojanz in #3032787-21: [META] Start creating the public PHP API of the JSON:API module.
Proposed resolution
Allow entity types to declare a JSON:API resource type name using ajsonapi_resource_type_name
entity type annotation key.- Add a new method to
\Drupal\jsonapi\ResourceType\ResourceTypeBuildEvent
.
(Option 2 is preferred by @e0ipso, @gabesullice and @Wim Leers because it solved more problems: it allows any module to override it. So: more power, more consistency, smaller API surface.)
Remaining tasks
User interface changes
None.
API changes
A new method on \Drupal\jsonapi\ResourceType\ResourceTypeBuildEvent
.
Data model changes
None.
Release notes snippet
TBD