Data types in YAML

YAML supports most of the data types of agile programming languages such as Perl, Python, PHP, Java, C#, Ruby, and JavaScript.

The following is the list of supported data types:

  • Boolean
  • Numbers
  • Strings
  • Dates
  • Timestamp
  • Arrays
  • Maps
  • Null

Variable (Scalars)

A name followed by a colon (:) and a single space ( ) defines a variable. Variables can also be referred to as scalars.

See the example below about how to represent variables in YAML.

Example

string: "Hello"
integer: 123
float: 12.345
boolean: No

Below is the graphical representation of the example above:

Get hands-on with 1400+ tech skills courses.