Skip to content

Commit

Permalink
Merge pull request #2407 from nickanderson/CFE-3551/3.15
Browse files Browse the repository at this point in the history
CFE-3551/3.15: Added inline JSON example
  • Loading branch information
nickanderson committed Feb 3, 2021
2 parents 6318969 + 3bb8e6c commit dc36953
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions reference/promise-types/vars.markdown
Expand Up @@ -209,15 +209,6 @@ modified, once created.
### Inline YAML and JSON data

Data containers can be specified inline, without calling functions.
For example:

```cf3
vars:
# JSON or YAML can be inlined since CFEngine 3.7
"inline1" data => '{"key":"value"}'; # JSON
"inline2" data => '---
- key2: value2'; # YAML requires "---" header followed by a newline
```

Inline YAML data has to begin with the `---` preamble followed by a newline. This preamble
is normally optional but here (for inline YAML) it's required by
Expand All @@ -236,6 +227,15 @@ references, it will be parsed at compile time, which means that
data early. Thus it is highly recommended that you try to avoid
variable references in your inline JSON or YAML data.

For example:
#### Inline Yaml example

[%CFEngine_include_example(inline-yaml.cf)%]

#### Inline Json example

[%CFEngine_include_example(inline-json.cf)%]

### Passing data containers to bundles

Data containers can be passed to another bundle with the
Expand Down

0 comments on commit dc36953

Please sign in to comment.