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
I tried using the API machinery YAML utility to split a stream of YAML documents into individual documents. It doesn’t seem to cope with certain cases and I am wondering if that was intentional, a restriction, or what.
In particular, directives don't appear to be grouped with the document they apply to. For example:
There are also small issues around when newlines are preserved.
Ideally, NewDocumentDecoder should satisfy these properties:
each document produced should be a valid YAML document consisting of a substring of the input string
when the documents produced are concatenated together, the resultant string should be equal to the input string
Here is some code and a test which pins down the unexpected behaviour a bit better: split.go.txt,split_test.go.txt. (I added the .txt to the filenames since I couldn't attach .go files.)
The text was updated successfully, but these errors were encountered:
I tried using the API machinery YAML utility to split a stream of YAML documents into individual documents. It doesn’t seem to cope with certain cases and I am wondering if that was intentional, a restriction, or what.
In particular, directives don't appear to be grouped with the document they apply to. For example:
splits into three documents instead of two:
See the code here which reproduces the above: https://play.golang.org/p/fgqRm_16LJV.
There are also small issues around when newlines are preserved.
Ideally,
NewDocumentDecoder
should satisfy these properties:Here is some code and a test which pins down the unexpected behaviour a bit better: split.go.txt,split_test.go.txt. (I added the
.txt
to the filenames since I couldn't attach.go
files.)The text was updated successfully, but these errors were encountered: