jsonapi.api.php currently says:
The JSON:API module provides *no PHP API to modify its behavior.*...This means that this module's implementation details are entirely free to change at any time.
And correspondingly, every class and interface are marked @internal.
However, I don't think that's tenable. We know there are use-cases for wanting to customize something. For example, renaming a field from its internal Drupal name to something friendlier (e.g., "uid" to "author"). That is currently supported by ResourceType::getPublicName()
. I think that's an example of something we should expose to a non-internal API (whether by creating a ResourceTypeInterface
, or via some other way).
Let's use this issue to collect other examples and spin-off child issues as needed.
Public PHP APIs shipped
- #3037039: Create a public API for indicating resource types should not be exposed
- #3085035: Add a public API for aliasing and disabling JSON:API resource type fields