Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Composition fails if reference field is undefined #390
A document with reference fields should return fully composed regardless of whether optional fields have been completed or not.
If a reference field does not hold a value, the composition process exits prematurely and a non-composed document is returned.
Steps to reproduce the problem
Create a collection with at least one reference field. Add documents to the collection which have one or more reference fields undefined. Perform a GET request to the collection - all reference fields should hold original ID values only, i.e. no composition has been performed.
An update to this. In general, composition works if a reference field doesn't exist in a document. This works fine when returning a single document. However when returning a result set containing multiple documents, the set of reference fields to attempt composition for is a merged array of reference field names extracted from the full set of documents.