JSON Examples
Simple Object
{
"name": "John Doe",
"age": 30,
"email": "john@example.com"
}
Nested Structure
{
"user": {
"profile": {
"name": "Jane",
"settings": {
"theme": "dark"
}
}
}
}
Array of Objects
{
"users": [
{"id": 1, "name": "Alice"},
{"id": 2, "name": "Bob"}
]
}
Configuration File
{
"database": {
"host": "localhost",
"port": 5432,
"credentials": {
"username": "admin",
"password": "secret"
}
}
}
YAML Examples
Simple Document
name: John Doe
age: 30
email: john@example.com
Nested Structure
user:
profile:
name: Jane
settings:
theme: dark
List/Array
users:
- id: 1
name: Alice
- id: 2
name: Bob
Docker Compose
version: '3.8'
services:
web:
image: nginx:latest
ports:
- "80:80"