The content delivery API produces invalid JSON when a reference resolver that is applied to a list returns Optional.Empty(). The issue is in info.magnolia.rest.delivery.jcr.NodeWriter#writeProperty:
See attached example of malformed json.
The use case for this is as follows: We’re converting a JCR object that bundles together a set of amazon s3:// asset to a model with hyperlinks. The issue happens when the JCR object with the s3 links gets deleted, but orphaned references remain.