accordproject / template-playground

Web Playground for TemplateMark templates
https://playground.accordproject.org
Apache License 2.0
17 stars 19 forks source link

TemplateMark not rendering relationships "resource" data #13

Open martinhalford opened 1 year ago

martinhalford commented 1 year ago

Context

Consider the template "Late Delivery and Penalty".

The model contains the definition:

import org.accordproject.party@0.2.0.Party from https://models.accordproject.org/accordproject/party@0.2.0.cto

@template
asset LateDeliveryAndPenaltyContract extends Contract {
  --> Party buyer
  --> Party seller

  /* ...rest of asset definition here
}

The data.json reads as follows:

{
    "$class": "org.accordproject.latedeliveryandpenalty@0.18.0.LateDeliveryAndPenaltyContract",
    "buyer": "resource:org.accordproject.party@0.2.0.Party#Steve",
    "seller": "resource:org.accordproject.party@0.2.0.Party#Dan",
     ...etc...
}

The grammar is defined as:

## Late Delivery and Penalty.

In case of delayed delivery{{#if forceMajeure}} except for Force Majeure cases,{{/if}}
{{seller}} (the Seller) shall pay to {{buyer}} (the Buyer) for every {{penaltyDuration}}
...

Expected Behavior

As per olde Template Studio, the text used to render as:

Late Delivery and Penalty.
----

In case of delayed delivery except for Force Majeure cases,
"Dan" (the Seller) shall pay to "Steve" (the Buyer) for every 2 days

Actual Behavior

The Template Playground renders the same model, grammar and data as:

## Late Delivery and Penalty.

In case of delayed delivery except for Force Majeure cases, 
"resource:org.accordproject.party@0.2.0.Party#Dan" (the Seller) shall pay to "resource:org.accordproject.party@0.2.0.Party#Steve" (the Buyer) for every {"$class":"org.accordproject.time@0.3.0.Duration","amount":2,"unit":"days"} 
...