muesli / beehive

A flexible event/agent & automation system with lots of bees 🐝
GNU Affero General Public License v3.0
6.31k stars 324 forks source link

Add JSON-Function for Templates #242

Closed mkrauser closed 5 years ago

mkrauser commented 5 years ago

This adds a json-Function to be used in String-Templates. In my Use-Case I serialize an entire Event and provide the Json-Document as Input to the ExecBee for further processing like this:

{{.|Json}}

I was not sure about the casing of "Json". I decided to go with that because it is easier to type and fits the existing functions. But technically it would be JSON.

muesli commented 5 years ago

Neat! Makes me want to rethink the way we handle JSON in the HttpBee.

muesli commented 5 years ago

I think JSON looks a little less weird. Want to change it to that?

mkrauser commented 5 years ago

I think JSON looks a little less weird. Want to change it to that?

Ok, no problem. I'm fine with both