mirror of https://github.com/status-im/NimYAML.git
Check for multiple documents when dumping JSON
This commit is contained in:
parent
5f6ed61e30
commit
280f0d6ce2
|
@ -580,6 +580,9 @@ proc present*(s: var YamlStream, target: Stream, tagLib: TagLibrary,
|
||||||
indentation -= options.indentationStep
|
indentation -= options.indentationStep
|
||||||
of yamlEndDoc:
|
of yamlEndDoc:
|
||||||
if finished(s): break
|
if finished(s): break
|
||||||
|
if options.style == psJson:
|
||||||
|
raise newException(YamlPresenterJsonError,
|
||||||
|
"Cannot output more than one document in JSON style")
|
||||||
safeWrite("..." & newline)
|
safeWrite("..." & newline)
|
||||||
|
|
||||||
proc transform*(input: Stream, output: Stream,
|
proc transform*(input: Stream, output: Stream,
|
||||||
|
|
Loading…
Reference in New Issue