FLAT
FLAT
Couper
Sevenval Technologies
Docker Image
Github
master
FLAT
Cookbook
Reference
Functions
Flow Actions
OpenAPI / Swagger Integration
Templating
{{,}}
Placeholder
?? Operator
with
loop
Dot {{.}}
Conditional `{{if <condition>}} … {{elseif <condition> }} … {{else}} … {{end}}
Object XML Notation (OXN)
Pair Producer {{: …}}
Template Variables
Comment {{// …}}
Variables
Flow
Configuration
Testing
flat CLI
Debugging
Administration
Tutorial
Changelog
Powered by GitBook

Templating

FLAT's template language is intended to dynamically generate JSON documents.

Basically, you provide the skeleton of the JSON object you want to create, and use placeholders instead of literal values. The language supports template commands that are documented below. Template expressions and functions offer rich means of accessing request and response data in JSON, HTML or XML (OXN).

​Comment {{// <comment>}}​

​Placeholder {{ <expression> }}​

​Dot {{.}}​

​Comma {{,}}​

​Pair Producer {{: <expression> }}​

​Variable Definition {{$<name> := <expression> }}​

​Conditional {{if <condition>}} … {{elseif <condition> }} … {{else}} … {{end}}​

​Loop {{loop <array>}} … {{end}}​

​Context Switch {{with <expression>}} … {{else}} … {{end}}​

​Null Coalescing Operator ??​

Previous
CORS - Cross-Origin Resource Sharing
Next
{{,}}
Last updated 2 years ago
Edit on GitHub
Contents
Comment {{// <comment>}}
Placeholder {{ <expression> }}
Dot {{.}}
Comma {{,}}
Pair Producer {{: <expression> }}
Variable Definition {{$<name> := <expression> }}
Conditional {{if <condition>}} … {{elseif <condition> }} … {{else}} … {{end}}
Loop {{loop <array>}} … {{end}}
Context Switch {{with <expression>}} … {{else}} … {{end}}
Null Coalescing Operator ??