services: added record extension registry #1781
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #1878
This PR introduces a new mechanism to extend the configured record class.
The idea is that some modules might want to add a single field (or method) to the record class, without polluting the core's RDM namespace.
The interface of these "extensions" is a callback that returns a valid Record class.
The extension point right now uses entry points since they can be loaded before all the extensions are initialised.
One example of a registration could be the following:
There are still unanswered questions to move forward:
strict
invenio-rdm-records
(without subclassing the serializer entirely)