XLAT Question

g4-lisz at tonarchiv.ch g4-lisz at tonarchiv.ch
Mon Apr 13 20:59:56 UTC 2026


Hi there,

I read about the default / alternation syntax for string expansion, like %{%{Foo}:-bar}.

But what I needed is this: 
  if (foo != '' ) ? '[ %{foo} ]' : 'null'.

This is for a JSON request string in a REST module configuration. The request property in question must be a JSON array (  [ .. ] ) or 'null'.

I could use Unlang IF and declare the complete JSON request in different versions depending on foo. But I would prefer to do this with expansion inside the JSON string definition, if possible.

Cheers
Till


More information about the Freeradius-Users mailing list