Skip to content

Commit

Permalink
Merge pull request #2408 from nickanderson/CFE-3551/3.12
Browse files Browse the repository at this point in the history
CFE-3551/3.12: Added inline JSON example
  • Loading branch information
nickanderson committed Feb 3, 2021
2 parents c573544 + f907693 commit e32b038
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 e32b038

Please sign in to comment.