From 8e6a47c948001195a622049559f8c796ea533a99 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Tue, 5 Nov 2024 10:42:23 +0100 Subject: [PATCH] document ??? operator of template engine --- .../hostsharing/hsadminng/hs/office/scenarios/README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/README.md b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/README.md index 037b151a..e8384ba2 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/README.md +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/scenarios/README.md @@ -76,9 +76,16 @@ Use `${...}` for placeholders which need to be replaced with JSON quotes `%{...}` for placeholders which need to be rendered raw and `&{...}` for placeholders which need to get URI-encoded. +If `???` is added before the closing brace, the property is optional. +This means, if it's not available in the properties, `null` is used. + Properties with null-values are removed from the JSON. If you need to keep a null-value, e.g. to delete a property, -use `NULL` (all caps). +use `NULL` (all caps) in the template (not the variable value). + +A special syntax is the infix `???`-operator like in: `${%{var1???}???%{var2???}%{var3???}}`. +In this case the first non-null value is used. + ### The Use-Case Verification