marklogic-community/pipes

[BUG] passing through headers, instance, attachments from source to output triggers wrapping in `value` property

Closed this issue · 2 comments

grtjn commented

I have a source block that exposes headers, triples, instance, attachments. These seem to be returned as Sequences, which seems counter-intuitive in most cases. The core code checks for type when putting things back into an envelope here:

https://github.com/marklogic-community/pipes/blob/master/ml-backend/src/main/ml-modules/root/custom-modules/pipes/core.sjs#L180

and when you pass through straight, you pass in a Sequence, so you get the extra { value: ... }, which is again not very intuitive.

It is annoying to have to put fn.head in between, so hoping v2 of pipes improves on this point.

I'm also wondering if we could add a fixed source block that exposes those envelope parts..

Yeah we can remove that "value" thing, however please note that we then get something like if feed in by sequence of 1,2,3,4:

{
headers: [1,2,3,4]
}

Revert this change. This cannot be done. the MakeEnvelope expect an object.