aboutsummaryrefslogtreecommitdiffstats
path: root/template-node/provider/src/test/resources/HideNullJson.vtl
blob: 306679457406cd778abab8a52642f4b5ff90fd5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
    }
  }
}