Skip to content

Instantly share code, notes, and snippets.

@koladilip
Created June 14, 2024 06:16
Show Gist options
  • Save koladilip/e25a6ac769ee5719e928720f5c439169 to your computer and use it in GitHub Desktop.
Save koladilip/e25a6ac769ee5719e928720f5c439169 to your computer and use it in GitHub Desktop.
Json Template Engine Mappings Example
{"code":"[\n {\n \"description\": \"Copies properties of a to root level in the output\",\n \"input\": \"$.a\",\n \"output\": \"$\"\n },\n {\n \"description\": \"Combines first and last name in the output\",\n \"input\": \"$.b[*].(@.firstName + ' ' + @.lastName)\",\n \"output\": \"$.items[*].name\"\n }\n]","name":"simple-example","type":"Mappings","data":"{\n \"a\": {\n \"foo\": 1,\n \"bar\": 2\n },\n \"b\": [\n {\n \"firstName\": \"foo\",\n \"lastName\": \"bar\"\n },\n {\n \"firstName\": \"fizz\",\n \"lastName\": \"buzz\"\n }\n ]\n}","bindings":"const bindings = {\n \"description\": \"Enter your bindings here\"\n };"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment