Skip to content

YAML Sets

Learn how to create unordered sets of unique values in YAML using the !!set tag and flow-style syntax, with examples and JSON equivalents.

YAML Sets

YAML Set (!!set) is an unordered set of non-equal values.

For example:

baseball-players: !!set
  ? Tom Nolan
  ? Ryan Raynolds
  ? John Smith

Another example:

set1: !!set
  ? one
  ? two
set1: !!set
  ? three
  ? four
Equivalent JSONjson
{
  "set1": {"one": null, "two": null},
  "set2": {"three": null, "four": null}
}
Navigation