You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fix itself is easy by adding an empty check before the return, however care needs to be taken to correctly parse an empty yaml document according to spec. Based on https://stackoverflow.com/a/62467269, returning null for an empty yaml document is likely the only spec-compliant answer. On the other Hand, if we follow the documented restrictions of the std.parseYaml then we should instead throw an error stating that scalars at the root are not supported. On the other, other Hand, the parser currently actually supports parsing both documents consisting only of comments and integer scalars, partially invalidating the documented restriction.
If you can give me guidance as to what the expected behaviour should be (return null, return empty map, return error) I'd be happy to provide a pull request
The text was updated successfully, but these errors were encountered:
The fix itself is easy by adding an empty check before the return, however care needs to be taken to correctly parse an empty yaml document according to spec. Based on https://stackoverflow.com/a/62467269, returning null for an empty yaml document is likely the only spec-compliant answer. On the other Hand, if we follow the documented restrictions of the std.parseYaml then we should instead throw an error stating that scalars at the root are not supported. On the other, other Hand, the parser currently actually supports parsing both documents consisting only of comments and integer scalars, partially invalidating the documented restriction.
If you can give me guidance as to what the expected behaviour should be (return null, return empty map, return error) I'd be happy to provide a pull request
The text was updated successfully, but these errors were encountered: