Creation of related entities attempted when not specified to be included #387
Labels
bug
Something isn't working
expands-search-api
Issues relating to the ExPaNDS Search API section of this repo
Description:
When using the Search API against ICAT < 5.0 where the ICAT mapping for the
instrument
field in theDataset
entity isinvestigation.investigationInstruments.instrument
, the following error is returned to the user when sending aGET
request to the/datasets
endpoint that has a filter to include theinstrument
entity.Error response:
Request URL:
From the error, it is clear that the Search API is attempting to create a
Document
entity despite this related entity not being specified to be included. The ICAT mapping for thedocuments
field in theDataset
entity isinvestigation
and because the data for theinstrument
field is retrieved via theinvestigation
entity, it means that the data returned from ICAT includesinvestigation
data, see response below.Click here for ICAT data
At the moment, when the Search API sees data for related entities in the ICAT data response (
investigation
in this case), it attempts to create corresponding Search API-related entities (document
in this case) even if they are not specified to be included.Acceptance criteria:
The text was updated successfully, but these errors were encountered: