YAML is a superset of JSON, So we can represent object and arrays in YAML

Let’s have an object in json as follows

{
  "id": 1	,
  "nae": "Franc"
}

Above can be presented in yaml as

---
id: 1
nae: Franc

Suppose you have a array of objects in json as

[{
  "id": 1	,
  "nae": "Franc"
},
{
  "id": 2	,
  "nae": "John"
}]

equivalent YAML file mapping

---
- id: 1
  nae: Franc
- id: 2
  nae: Joh

Suppose you have a have nested array of objects which has array of strings for one of the property

[{
  "id": 1	,
  "nae": "Franc",
  "roles":["admin","hr"]
},
{
  "id": 2	,
  "nae": "John",
    "roles":["admin","finance"]

}]

In this object, roles has a array of strings

YAML nested array of objects

---
- id: 1
  nae: Franc
  roles:
  - admin
  - hr
- id: 2
  name: John
  roles:
  - admin
  - finance

One more example of nested objects array

{"data":
  [{
  "id": 1	,
  "name": "Franc",
  "roles":["admin","hr"]
},
{
  "id": 2	,
  "name": "John",
    "roles":["admin","finance"]

}]
}

data property contains nested array of objects which can be yaml as follows

---
data:
- id: 1
  nae: Franc
  roles:
  - admin
  - hr
- id: 2
  nae: John
  roles:
  - admin
  - finance