You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem:
In B2Share code we were using invenio-records-rest with a few different endpoints (POST creates a deposit instead of a Record). Because of that we were using invenio-records-rest as a library and we disabled the automatic creation of endpoints (RECORDS_REST_ENDPOINTS={} in config). We reused the View classes and replaced the only method which was blocking us, i.e RecordsListResource.post. This does not work anymore as The views code depend explicitly on the config variable RECORDS_REST_ENDPOINTS (see ext.py and views.py)
From what I understood at the time this was implemented in B2Share, using invenio-records-rest as a library was an accepted use-case so I mark this as a bug.
I don't know if others are using Invenio-records-rest as a library. If it is only us we can also say that the config RECORDS_REST_ENDPOINTS is mandatory.
For B2Share what we need is to be able to override one of the view methods. Another solution which would work for us would be to specify custom View classes.
Note that this also impacts invenio-deposits as we are also customising its REST API endpoints (removing completely the B2ShareRecordsListResource and customizing the RecordResource methods).
If B2Share was requiring Views subclasses there should have been tests to check it. Tests are basically the only specifications.
it should be possible to set _RecordRESTState.default_endpoint_prefixes on before_first_request.
I will add a test checking that invenio-records-rest can be used as a library. By library I mean reuse the provided View Resource classes but without having invenio-records-rest generating the endpoints.
Problem:
In B2Share code we were using invenio-records-rest with a few different endpoints (POST creates a deposit instead of a Record). Because of that we were using invenio-records-rest as a library and we disabled the automatic creation of endpoints (
RECORDS_REST_ENDPOINTS={}
in config). We reused the View classes and replaced the only method which was blocking us, i.eRecordsListResource.post
. This does not work anymore as The views code depend explicitly on the config variableRECORDS_REST_ENDPOINTS
(see ext.py and views.py)From what I understood at the time this was implemented in B2Share, using invenio-records-rest as a library was an accepted use-case so I mark this as a bug.
Blocks #99
The text was updated successfully, but these errors were encountered: