I'm trying to add a map to an array of maps in ytt to modify a YAML doc.
I tried the below but it errors out and says it expects a map but getting an array.
https://gist.github.com/amalagaura/c8b5c7c92402120ed76dec95dfafb276
---
id: 1
type: book
awards:
books:
- id: 1
title: International Botev
reviewers:
- id: 2
name: PersonB
- id: 2
title: Dayton Literary Peace Prize
reviewers:
- id: 3
name: PersonC
#! How do I add a map to an array of maps?
#@ load("@ytt:overlay", "overlay")
#@overlay/match by=overlay.all
---
awards:
books:
#@overlay/match by=overlay.all, expects="1+"
#@overlay/match missing_ok=True
reviewers:
#@overlay/append
- id: 1
name: PersonA