candlecorp / wick

Functional, reactive WebAssembly with a twist
https://candle.dev
Other
471 stars 17 forks source link

Added lax support for null/nonexistant variables in liquid templates #438

Closed jsoverson closed 1 year ago

jsoverson commented 1 year ago

This PR updates liquid-json to add support for setting defaults or otherwise handling non-existant values in liquid templates, e.g.:

resources:
  - name: http
    resource:
      kind: wick/resource/tcpport@v1
      port: '{{ ctx.env.HTTP_PORT | default: 8999 }}'
      address: '{{ ctx.env.HTTP_ADDRESS | default: "127.0.0.1"}}'