[GH-ISSUE #721] YAML schema build can not handle arrays with multiple items #517

Closed
opened 2026-03-03 01:27:38 +03:00 by kerem · 0 comments
Owner

Originally created by @aepfli on GitHub (Feb 15, 2023).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/721

issue

If there is a configuration parameter, which is an array of elements, and you have multiple default elements, it is not generating valid yaml

input

     "defaults": [ "a", "b", "c"]

actual

defaults: [
   "a"
   "b"
   "c"
]

expected

defaults: 
   - "a"
   - "b"
   - "c"

Proposal

By using YAML.stringify we have the appropriate behavior, with the usage of https://www.npmjs.com/package/yaml (additional dependency). Instead of doing replacements within the JSON string to currently generate the YAML.

Originally created by @aepfli on GitHub (Feb 15, 2023). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/721 ## issue If there is a configuration parameter, which is an array of elements, and you have multiple default elements, it is not generating valid yaml ### input ``` "defaults": [ "a", "b", "c"] ``` ### actual ```yaml defaults: [ "a" "b" "c" ] ``` ### expected ```yaml defaults: - "a" - "b" - "c" ``` ## Proposal By using `YAML.stringify` we have the appropriate behavior, with the usage of https://www.npmjs.com/package/yaml (additional dependency). Instead of doing replacements within the JSON string to currently generate the YAML.
kerem 2026-03-03 01:27:38 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#517
No description provided.