aboutsummaryrefslogtreecommitdiffstats
path: root/template-node/provider/src/test/resources
diff options
context:
space:
mode:
authorSmokowski, Kevin (ks6305) <kevin.smokowski@att.com>2019-01-03 22:00:51 +0000
committerKevin Smokowski <kevin.smokowski@att.com>2019-01-03 22:04:46 +0000
commit57fd31e090909d55a36f957e45a84d9295254d44 (patch)
treedd2d69f9285b060b850e868b4e2554b23605b037 /template-node/provider/src/test/resources
parent62e62331a294052109f02686e4529fe613355990 (diff)
create a directive for the template node
The directive is called hideNullJson, it hides json when it is null to deal with optional json attributes Change-Id: I0b7a2c2f19e6f83e0d8c8c6f3552889c83dc997f Issue-ID: CCSDK-903 Signed-off-by: Smokowski, Kevin (ks6305) <kevin.smokowski@att.com>
Diffstat (limited to 'template-node/provider/src/test/resources')
-rwxr-xr-xtemplate-node/provider/src/test/resources/HideNullJson.vtl22
1 files changed, 22 insertions, 0 deletions
diff --git a/template-node/provider/src/test/resources/HideNullJson.vtl b/template-node/provider/src/test/resources/HideNullJson.vtl
new file mode 100755
index 00000000..30667945
--- /dev/null
+++ b/template-node/provider/src/test/resources/HideNullJson.vtl
@@ -0,0 +1,22 @@
+## This is an example comment
+## This velocity template is used to test the hideNullJson directive
+{
+ "input": {
+ "request-header": {
+## by default the values parameters provided are surrounded in double quotes and separated by a colon
+ #hideNullJson("svc-request-id",$svc-request-id)#end
+## override default settings so the comma isn't written
+ #hideNullJson("svc-action",$svc-action, true, true, false)#end
+ },
+ "service-information": {
+## if we look at the values in parameters we see service-type is already surrounded by quotes
+## we override the default so the string isn't surrounded by excess quotes
+ #hideNullJson("service-type",$service-type,true,false,true)#end
+## the first parameter doesn't need to be a literal
+ #hideNullJson($customerNameTag,$customer-name)#end
+## if the first parameter already has already been quoted we can override the default
+ #hideNullJson($siidTag,$service-instance-id,false,true,false)#end
+ #hideNullJson("customer-phone-number",$customer-phone-number)#end
+ }
+ }
+} \ No newline at end of file