XLAT Question

[email protected] Mon, 13 Apr 2026 20:59:56 +0000
Newsgroups gmane.comp.freeradius.user
Message-ID <[email protected]>
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
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html