yamlの記法を理解するための練習問題
以下のJSONをyamlに変換してください
code:problem1.json
{
"name": "John Doe",
"age": 30,
"city": "New York"
}
code:problem2.json
{
"user": {
"username": "johndoe",
"email": "john@example.com"
},
"posts": [
{
"title": "Hello World",
"content": "This is my first post."
},
{
"title": "YAML vs JSON",
"content": "Comparing YAML and JSON formats."
}
]
}
code:problem3.json
{
"car": {
"make": "Toyota",
"model": "Camry",
"year": 2023,
}
}
/icons/hr.icon
code:problem1-ans.yaml
name: "John Doe"
age: 30,
city: "New York"
code:problem2-ans.yaml
user:
username: "johndoe"
email: "john@example.com"
posts:
- title: "Hello World"
content: "This is my first post"
- title: "YAML vs JSON"
content: "Comparing YAML and JSON formats."
code:problem3-ans.json
car:
make: "Toyota"
model: "Camry"
year: 2023
options:
- "Automatic transmission"
- "Sunroof"
- "Navigation"
public.icon