Closed jasonjoh closed 1 month ago
YAML validation is too simplistic, and flags YAML mult-line arrays as Incorrect YAML header format.
Incorrect YAML header format
New TOC generation tool uses an array for a property called toc.keywords. Putting the value like this:
toc.keywords
toc.keywords: - keyword1 - keyword2
Results in an error. Putting it like this passes:
toc.keywords: [ keyword1, keyword2 ]
Issue is in ParseYamlMetdata, which seems to assume every property will be a name/value pair:
https://github.com/OneDrive/apidoctor/blob/7d2f4a3b6d6689dbf774323b078d00ca876818ad/ApiDoctor.Validation/DocFile.cs#L398-L399
It would be better to replace this custom processing of YAML with a library like YamlDotNet, which can handle all of the YAML formats, and can deserialize into a strongly-typed object.
YAML validation is too simplistic, and flags YAML mult-line arrays as
Incorrect YAML header format
.New TOC generation tool uses an array for a property called
toc.keywords
. Putting the value like this:Results in an error. Putting it like this passes:
Issue is in ParseYamlMetdata, which seems to assume every property will be a name/value pair:
https://github.com/OneDrive/apidoctor/blob/7d2f4a3b6d6689dbf774323b078d00ca876818ad/ApiDoctor.Validation/DocFile.cs#L398-L399
It would be better to replace this custom processing of YAML with a library like YamlDotNet, which can handle all of the YAML formats, and can deserialize into a strongly-typed object.