-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
YAML output should use document separators #628
Comments
If I'm understanding the spec right, a |
A document start ( I would suggest emitting a document start before each object after the first rather than simply replacing the current blank line with But all of this depends on whether YAML is just for human reading or is ever intended as a parsed output format. I'm assuming that the current rendering is using VT sequences for color and thus would need to have a way to disable that (either automatically or with |
@JohnMcPMS , you bring up a good point, the current YAML output is only intended for humans as any redirection will, by default, result in JSON. Is there any example usage that results in multi YAML docs being in the output? Any configuration operation should result in just a single object. |
I would argue that each resource should be its own document, as each one results in repetitions of |
Summary of the new feature / enhancement
YAML supports multiple documents in a single stream. However, the current YAML output separates "documents" only by an empty line. While this convention can work, it is fragile. Even built-in resources have "empty" lines in their descriptions (see
Microsoft/OSInfo
). Placing an explicit document separator between entries (such as those ofdsc resource list
) would allow parsing the output stream directly without the need to pre-process the documents into individual parts. It would also make the start of a new item much easier to find as a human reader.Proposed technical implementation details (optional)
At a minimum, output a document start and end sequence for each "document" in the output. For a cleaner look, only output a document start sequence before each "document" after the first.
The text was updated successfully, but these errors were encountered: