paste outputs values/elements even if there not all or none of the expected elements are provided by an record. I would expect that it would only process if all elements are provided and not if none or only some are provided.
$ catmandu convert JSON --fix 'paste("combine", "name", "~is a", "type")' to YAML < input.json
---
combine: Blacky is a bird
name: Blacky
type: bird
...
---
combine: Test is a
name: Test
test_1: test_1
...
---
combine: is a
test_1: test_1
test_2: test_2
...
I would have expected:
---
combine: Blacky is a bird [Blacky bird]
name: Blacky
type: bird
...
---
name: Test
test_1: test_1
...
---
test_1: test_1
test_2: test_2
...
Yes, this is the intended behaviour. The paste command will create a new path with the other arguments as template (even when they don't exist). I'll document this
paste
outputs values/elements even if there not all or none of the expected elements are provided by an record. I would expect that it would only process if all elements are provided and not if none or only some are provided.Is this intentional behaviour of
paste
?input:
without additional string:
with additional string:
I would have expected: