Bug Report 🐛
Please see LOOM video for demo of bug.
https://www.loom.com/share/4d628fd1e1ec4afa9d5a50444e69ebe9
In summary, optional variables return unexpected results when interrogated in code blocks within grammar.tem.md files.
An optional DateTime variable myDate is defined as:
o DateTime myDate optional
A value in the data.json file is set as...
"myDate": "2000-01-01T00:00:00"
A code block is defined in the grammar.tem.md as:
{{%
match some(myDate)
with let? completionDate then "YES - Found myDate - " ++ toString(myDate)
else "NO - myDate not found"
%}}
A draft command is executed as:
cicero draft --template . --data ./data.json --unquoteVariables
and the following response is returned...
YES - Found myDate - {"$left": 01/01/2000}
When the myDate value is deleted from data.json and the same draft command executed then the following response is returned.
YES - Found myDate - {"$right": null}
Expected Result
If myDate present then expected
YES - Found myDate - 01/01/2000
If myDate not present then expected
Example CTA archive attached:
OptionalDateTime CTA
Bug Report 🐛
Please see LOOM video for demo of bug.
https://www.loom.com/share/4d628fd1e1ec4afa9d5a50444e69ebe9
In summary,
optionalvariables return unexpected results when interrogated in code blocks withingrammar.tem.mdfiles.An optional DateTime variable
myDateis defined as:A value in the
data.jsonfile is set as...A code block is defined in the
grammar.tem.mdas:A
draftcommand is executed as:and the following response is returned...
When the
myDatevalue is deleted fromdata.jsonand the samedraftcommand executed then the following response is returned.Expected Result
If
myDatepresent then expectedIf
myDatenot present then expectedExample CTA archive attached:
OptionalDateTime CTA