{
    "Id":
        {{#with (elementAt (toArray obj.id) 0) as |FirstId|}}
            {{#if (and FirstId.root FirstId.extension)}}
                "{{generateUUID (concat (toString FirstId.root) '|' (toString FirstId.extension))}}"
            {{else if FirstId.root}}
                {{!--If only root is provided, it is supposed to be unique--}}
                "{{generateUUID (toString FirstId.root)}}"
            {{else}}
                {{!--Generate using obj if no root or id is available--}}
                "{{generateUUID (toJsonString ..)}}"
            {{/if}}
        {{/with}}
}