Common causes
1. An item property indented one space short
The properties of a list item must line up with the first key after the dash. Here value starts one column left of name, so it belongs to neither the item nor the list.
- name: REGION
value: "eu-west-1"- name: REGION
value: "eu-west-1"2. A key placed at the dash column inside a list
In a GitHub Actions or CI file, writing a key at the same indentation as the dashes ends the list as far as you are concerned, but not for the parser. Move it out to its parent’s level or make it an item.
steps:
- name: Test
run: npm test
name: Deployname: Deploy
steps:
- name: Test
run: npm test3. A new item written without its dash
Adding an item by copying the properties of the previous one but forgetting - leaves a mapping inside the list. Every item needs its own dash.
ports:
- containerPort: 80
containerPort: 443ports:
- containerPort: 80
- containerPort: 443Frequently asked questions
Do list dashes need to be indented under their key?
No. Both “key:\n- item” and “key:\n - item” are valid. What matters is that every dash in the same list sits in the same column and that each item’s properties line up after the dash.
What does PyYAML's "expected <block end>, but found '?'" mean?
It is PyYAML’s wording for the same problem: inside a block collection it expected the list to continue or end and found a mapping key (‘?’) instead.
How can I see the structure the parser is building?
Fix the first error PasteKit reports, then open the Tree view. It shows which keys belong to which list item, which quickly reveals an item that swallowed a sibling’s property.