Skip to content

Composition fails if reference field is undefined #390

@jimlambie

Description

@jimlambie

Expected behaviour

A document with reference fields should return fully composed regardless of whether optional fields have been completed or not.

Actual behaviour

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.

Package details

@dadi/api@3.0.0
@dadi/api-mongodb@3.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions