Skip to content

Commit 5ece949

Browse files
joelkeenermstokes-f5
authored andcommitted
doc: content-type example
1 parent cbaaa65 commit 5ece949

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

docs/getting_started.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,44 @@ When FAST renders it is doing string replacement via Mustache, which is agnostic
7474
* Post-processing steps (e.g., strip dangling commas for JSON)
7575
* Smarter merges
7676
* Smarter handling of some data types
77+
78+
Here is an example of using application/json for the content type:
79+
80+
Template:
81+
```yaml
82+
title: Members in JSON List
83+
contentType: application/json
84+
template: |
85+
{
86+
"members": [
87+
{{#members}}
88+
{ "ipAddr": "{{ . }}" },
89+
{{/members}}
90+
]
91+
}
92+
```
93+
94+
Parameters:
95+
```yaml
96+
members:
97+
- 10.0.0.1
98+
- 10.0.0.2
99+
- 10.0.0.3
100+
```
101+
102+
Output:
103+
```
104+
{
105+
"members": [
106+
{
107+
"ipAddr": "10.0.0.1"
108+
},
109+
{
110+
"ipAddr": "10.0.0.2"
111+
},
112+
{
113+
"ipAddr": "10.0.0.3"
114+
}
115+
]
116+
}
117+
```

0 commit comments

Comments
 (0)