Questions tagged [yaml]

Use this tag for questions about the YAML data serialization format only, not for questions about programs (or examples) that happen to have their configuration in a YAML format. Questions about the CSS framework also called YAML should be tagged [yaml-css] instead.

From the Wikipedia article about YAML:

YAML (/ˈjæməl/, rhymes with camel) is a human-readable data serialization language that takes concepts from programming languages such as C, Perl, and Python, and ideas from XML and the data format of electronic mail (RFC 2822). YAML was first proposed by Clark Evans in 2001, who designed it together with Ingy döt Net and Oren Ben-Kiki. It is available for several programming languages.

YAML is a recursive acronym for "YAML Ain't Markup Language". Early in its development, YAML was said to mean "Yet Another Markup Language", but it was then reinterpreted (backronyming the original acronym) to distinguish its purpose as data-oriented, rather than document markup.

Features:

  • Its familiar indented outline and lean appearance make it especially suited for tasks where humans are likely to view or edit data structures, such as configuration files, dumping during debugging, and document headers.
  • Although well-suited for hierarchical data representation, it also has a compact syntax for relational data as well.
  • A major part of its accessibility comes from eschewing the use of enclosures like quotation marks, brackets, braces, and open/close-tags, which can be hard for the human eye to balance in nested hierarchies.

See also

Related tags

15259 questions
5
votes
2 answers

Webpack - Yaml -> JSON -> Extract file

I have a YAML file with a few translations. I need to transform these files into a JSON file. I've tried using yaml-import-loader and json-loader but I get an error. Here's my setup: const ExtractTextPlugin =…
Got The Fever Media
  • 750
  • 1
  • 9
  • 27
5
votes
1 answer

Error: pandoc document conversion failed with error 2 with pkgdown / rmarkdown

I'm trying to build a website with pkgdown so I ran pkgdown::build_site(). This throws the following error: Building article 'index.html' Error: pandoc document conversion failed with error 2 There was a similar problem on SO but the answer didn't…
epo3
  • 2,991
  • 2
  • 33
  • 60
5
votes
2 answers

Ansible include_vars into dictionary

In my ansible playbook, I read a list of directories into a list. I then want to read a "config.yml" file from each of these directories and put their content into dictionary, so that I can reference the config-data via the directory name from that…
feob
  • 1,930
  • 5
  • 19
  • 31
5
votes
1 answer

the best way to parse and validate YAML configuration file

We have project which stores settings in YAML (settings file is generated by ansible scripts). Now we are using pyyaml to parse YAML format and marshmallow to validate settings. I'm pretty happy with storing setting in YAML, but I don't think…
Helvdan
  • 416
  • 4
  • 14
5
votes
1 answer

Ansible concat default variable and literal string

I'm not able to do a very simple thing. In my task I'm trying to concat two default variables with a literal string to create a path - name: "Uploading File" copy: src: "{{ installer_iso_src_location }}"/"{{ installer_version…
Anand Rao
  • 303
  • 3
  • 4
  • 8
5
votes
3 answers

Error creating BucketPolicy in CloudFormation yaml

I'm trying to use the following yaml to create an S3 Bucket Policy in CloudFormation: cloudTrailBucketPolicy: Type: "AWS::S3::BucketPolicy" Properties: Bucket: Ref: cloudtrailBucket PolicyDocument: - …
Xanxir
  • 476
  • 1
  • 8
  • 13
5
votes
3 answers

Symfony+Doctrine: Correct YAML syntax for default value of boolean field

I am working on the schema for my Symfony app, and I need to set the default value of two boolean fields to false. However, with all the ways I've tried to do it, when the sql gets generated, it comes out with the default keyword, but no default…
The.Anti.9
  • 43,474
  • 48
  • 123
  • 161
5
votes
1 answer

two items with the same attributes in YAML

It is possible, to do several items in YAML file with identical attributes, but with out need to actually duplicate them? For example, I have: item1: it_one: some: {...} it_two: somemore: {...} item2: …
Andreios
  • 53
  • 1
  • 5
5
votes
2 answers

YAML to JSON Ruby

I have a YAML file that looks like this (with bot names and their parameters): conf_file: pipeline_conf_path: /opt/etc/pipeline.conf runtime_conf_path: /opt/etc/runtime.conf asn_lookup: parameters: database:…
mf370
  • 321
  • 3
  • 14
5
votes
1 answer

Can't construct object from parameter in constructor called by PyYAML

I have a YAML file that looks like this: --- !Frog name: tree frog colour: green friends: - !Frog name: motorbike frog - !Frog name: blue arrow frog And a python program that uses PyYAML to create…
ToxicTeacakes
  • 1,124
  • 1
  • 10
  • 19
5
votes
2 answers

Unmarshal YAML into unknown struct

Sorry for the confusing title, I'm having trouble wording this question. So lets say I have a YAML config file like this animals: - type: whale options: color: blue name: Mr. Whale features: - type:…
Weston
  • 1,291
  • 3
  • 12
  • 25
5
votes
2 answers

Pulling from specific subfolders using {% for post in site.posts %}

I'm currently working on my first Jekyll site. I have a page in which 2 seperate sections display previews of certain posts (a styled thumbnail). What I want is for these sections to display posts from different subfolders in _site/_posts. I have…
5
votes
1 answer

Read YAML metadata from a Pandoc markdown file

Is it possible to extract Pandoc's metadata (title, date, et al.) from a markdown file without a Haskell filter, or parsing the --to=json output? The JSON output is particularly inconvenient for this, since a two-word title looks like: $ pandoc -t…
OJFord
  • 10,522
  • 8
  • 64
  • 98
5
votes
2 answers

Spring Boot yaml nested property map to Configuration class HashMap

I have a configuration class named CommonConfig that has been working fine so far… @Data @Component @ConfigurationProperties(prefix = “my") public class CommonConfig { private String foo; private String bar; private SubA subA; @Data …
deinspanjer
  • 495
  • 1
  • 7
  • 22
5
votes
1 answer

Convert YAML multi-line values to folded block scalar style?

Using ruamel.yaml I tried to get a YAML in a certain style, more specifically one where single-line strings start at same line as : and multi-line strings using a folded scalar style (|/|-) and lines being limited to a certain amount of characters…
phk
  • 2,002
  • 1
  • 29
  • 54
1 2 3
99
100