languageservices icon indicating copy to clipboard operation
languageservices copied to clipboard

Fix: correct error handling for non-string keys in YAML validation

Open kfess opened this issue 7 months ago • 0 comments

Description This PR fixes the incorrect error messages that appear when YAML files contain non-string keys (numbers, null, boolean values) in the GitHub Actions VSCode extension. I think the issue is caused by the YAML parser assuming all keys are strings without proper type conversion.

Changes Made

  • Modified the YAML parser to properly convert all scalar values to strings before processing
  • Replaced the type assertion as string with explicit string conversion using String()
  • Added special handling for null values to convert them to empty strings, matching the GitHub Actions runner behavior
  • Fixed JavaScript errors like i.indexOf is not a function that occurred with numeric keys
  • Ensured boolean keys (true/false) are properly stringified

Fix #185

kfess avatar May 12 '25 13:05 kfess