DEV Community

Cover image for YAML Data Types
Md Abu Musa
Md Abu Musa

Posted on

YAML Data Types

YAML file containing different data types such as strings, numbers, lists, dictionaries, booleans, and null values:

# Example YAML file with various data types

# Strings
name: John Doe
occupation: Software Engineer

# Integers and Floats
age: 30
salary: 75000.50

# Booleans
is_active: true
is_manager: false

# Null value
nickname: null

# Lists
skills:
  - PHP
  - Laravel
  - JavaScript
  - Docker
  - AWS

# Dictionary
address:
  street: 123 Main St
  city: New York
  state: NY
  zip_code: 10001

# Nested Lists and Dictionaries
education:
  - degree: B.Sc in Computer Science
    university: University of XYZ
    graduation_year: 2015
  - degree: M.Sc in Software Engineering
    university: ABC Institute
    graduation_year: 2018

# Complex Dictionary with Multiple Data Types
project_details:
  project_name: AI Chatbot
  duration_in_months: 6
  completed: true
  team_members:
    - name: Alice
      role: Team Lead
    - name: Bob
      role: Developer
    - name: Charlie
      role: Tester
Enter fullscreen mode Exit fullscreen mode

This file illustrates how you can structure YAML to represent various data types and organize them in a readable manner.

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay