Skip to Content
Error CodesYAML Validation Errors

YAML Validation Errors

These errors appear when validating or parsing YAML configuration files, particularly in the Converter and Developer Mode.


Error Patterns

Bad Indentation

Message: “The file has a formatting error: indentation (spaces at the beginning of the line) is incorrect.”

Cause: YAML uses spaces for indentation, and they must be consistent.

Bad example:

items: my_item: display_name: "Sword" material: PAPER # Wrong! Inconsistent indentation

Fixed:

items: my_item: display_name: "Sword" material: PAPER

Rule: Use 2 spaces per indentation level. Never mix tabs and spaces.


Unexpected End of File

Message: “The file is incomplete. Verify that all sections are properly closed.”

Cause: The YAML file is cut off or missing closing elements.

Bad example:

items: my_item: display_name: "Sword" material:

Fixed:

items: my_item: display_name: "Sword" material: PAPER

Duplicate Key

Message: “The file has duplicate keys. Each property name must be unique in its section.”

Cause: The same key appears twice at the same level.

Bad example:

items: my_item: display_name: "Sword" material: PAPER display_name: "Better Sword" # Duplicate!

Fixed:

items: my_item: display_name: "Better Sword" material: PAPER

Unexpected Token

Message: “The file has an unexpected character. Check the file syntax.”

Cause: A character appeared where YAML didn’t expect it.

Common causes:

  • Unquoted strings starting with special characters ({, [, *, &, !, %, @)
  • Missing colon after a key
  • Missing space after the colon

Bad example:

items: my_item: display_name:Sword # Missing space after colon

Fixed:

items: my_item: display_name: Sword

Invalid Tag

Message: “The file contains an invalid YAML tag.”

Cause: An unrecognized YAML tag was used (e.g., !!python/object).

Solution: Remove any YAML tags that start with ! unless they are specifically required by your plugin.


Mapping Values Not Allowed

Message: “The file has a structure error. Verify that values are correctly assigned with ’:’.”

Cause: A value was placed where a mapping key was expected.

Bad example:

items: my_item: display_name: "My Item" material: PAPER # Wrong level — should be inside my_item

Fixed:

items: my_item: display_name: "My Item" material: PAPER

Incomplete Key-Value Pair

Message: “The file has an incomplete property. Make sure each key has an assigned value.”

Cause: A key exists without a value, and YAML can’t infer what it should be.

Bad example:

items: my_item: display_name: material: PAPER

Fixed:

items: my_item: display_name: "My Item" material: PAPER

Tab Character

Message: “The file uses tabs instead of spaces. YAML only allows spaces for indentation.”

Cause: Tab characters (\t) were used for indentation.

Solution:

  1. Configure your text editor to use spaces instead of tabs
  2. In VS Code: Settings > Editor: Insert Spaces = true, Tab Size = 2
  3. Use “Convert Indentation to Spaces” command in your editor

Empty File

Message: “The file is empty. Upload a YAML file with valid content.”

Solution: Make sure the file you’re uploading actually contains YAML content and isn’t a 0-byte file.


Tips for Writing Valid YAML

  1. Always use spaces (2 per level), never tabs
  2. Quote strings that contain special characters: display_name: "Item: Special"
  3. Validate before uploading using the Developer Mode editor, which provides real-time feedback
  4. Use a YAML-aware editor like VS Code with the YAML extension