accordproject / template-playground

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

Type checker doesn't detect usage of optional properties #11

Open dselman opened 1 year ago

dselman commented 1 year ago
Hello {{name}}! 

Today is **{{% return now.toISOString() %}}**.

{{last}}
namespace hello@1.0.0

@template
concept HelloWorld {
    o String name
    o String last optional
}

Context

This is detected if last is used in a TS expression, but not as a simple variable.

Expected Behavior

Should raise an error that {{last}} is being used and is an optional.

Actual Behavior

Runtime failure:

Error: No values found for path '$['last']' in data [object Object].

Possible Fix

Steps to Reproduce

1. 2. 3. 4.

Existing issues

Context

Your Environment

Vinyl-Davyl commented 5 months ago

Hello @dselman permit me to work on this issue