Unwrap scalar now works for JSON encoding when explicitly set #1409

This commit is contained in:
Mike Farah
2022-11-10 19:21:18 +11:00
parent fae1dbf0be
commit 1d35134310
10 changed files with 147 additions and 19 deletions
+1 -1
View File
@@ -98,7 +98,7 @@ func configurePrinterWriter(format yqlib.PrinterOutputFormat, out io.Writer) (yq
func configureEncoder(format yqlib.PrinterOutputFormat) yqlib.Encoder {
switch format {
case yqlib.JSONOutputFormat:
return yqlib.NewJSONEncoder(indent, colorsEnabled)
return yqlib.NewJSONEncoder(indent, colorsEnabled, unwrapScalar)
case yqlib.PropsOutputFormat:
return yqlib.NewPropertiesEncoder(unwrapScalar)
case yqlib.CSVOutputFormat: