Skip to content

Commit 97c4bef

Browse files
committed
Fixed an alignment problem in the pretty output of json
1 parent 3b496e9 commit 97c4bef

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1313
### Fixed
1414

1515

16+
## [0.7.1] - 2020-03-11
17+
18+
### Fixed
19+
- Fixed an alignment problem in the pretty output of json.
20+
21+
1622
## [0.7.0] - 2020-03-09
1723

1824
### Changed

json_utils.pkb

+9-6
Original file line numberDiff line numberDiff line change
@@ -551,37 +551,40 @@ BEGIN
551551

552552
PRAGMA INLINE (add_string, 'YES');
553553
json_utils.add_string(theLobBuf, theStrBuf, aName);
554+
ELSE
555+
PRAGMA INLINE (add_string, 'YES');
556+
json_utils.add_string(theLobBuf, theStrBuf, GAP);
554557
END IF;
555558

556559
-- Add the property value
557560
CASE aNode.typ
558561

559562
WHEN json_utils.NODE_TYPE_NULL THEN
560563
PRAGMA INLINE (add_string, 'YES');
561-
json_utils.add_string(theLobBuf=>theLobBuf, theStrBuf=>theStrBuf, theValue=>GAP || 'null');
564+
json_utils.add_string(theLobBuf=>theLobBuf, theStrBuf=>theStrBuf, theValue=>'null');
562565

563566
WHEN json_utils.NODE_TYPE_STRING THEN
564567
PRAGMA INLINE (escape, 'YES');
565-
json_utils.add_string(theLobBuf=>theLobBuf, theStrBuf=>theStrBuf, theValue=>GAP || '"' || escape(theString=>aNode.str, theAsciiOutput=>outputOptions.ascii_output, theEscapeSolitus=>outputOptions.escape_solitus) || '"');
568+
json_utils.add_string(theLobBuf=>theLobBuf, theStrBuf=>theStrBuf, theValue=>'"' || escape(theString=>aNode.str, theAsciiOutput=>outputOptions.ascii_output, theEscapeSolitus=>outputOptions.escape_solitus) || '"');
566569

567570
WHEN json_utils.NODE_TYPE_LOB THEN
568571
PRAGMA INLINE (add_string, 'YES');
569-
json_utils.add_string(theLobBuf=>theLobBuf, theStrBuf=>theStrBuf, theValue=>GAP || '"');
572+
json_utils.add_string(theLobBuf=>theLobBuf, theStrBuf=>theStrBuf, theValue=>'"');
570573
PRAGMA INLINE (escapeLOB, 'YES');
571574
escapeLOB(theInputLob=>aNode.lob, theLobBuf=>theLobBuf, theStrBuf=>theStrBuf, theAsciiOutput=>outputOptions.ascii_output, theEscapeSolitus=>outputOptions.escape_solitus);
572575
PRAGMA INLINE (add_string, 'YES');
573576
json_utils.add_string(theLobBuf=>theLobBuf, theStrBuf=>theStrBuf, theValue=>'"');
574577

575578
WHEN json_utils.NODE_TYPE_NUMBER THEN
576579
PRAGMA INLINE (number_to_json, 'YES');
577-
json_utils.add_string(theLobBuf=>theLobBuf, theStrBuf=>theStrBuf, theValue=>GAP || number_to_json(aNode.num));
580+
json_utils.add_string(theLobBuf=>theLobBuf, theStrBuf=>theStrBuf, theValue=>number_to_json(aNode.num));
578581

579582
WHEN json_utils.NODE_TYPE_DATE THEN
580-
json_utils.add_string(theLobBuf=>theLobBuf, theStrBuf=>theStrBuf, theValue=>GAP || '"' || TO_CHAR(aNode.dat, 'FXYYYY-MM-DD"T"HH24:MI:SS') || '"');
583+
json_utils.add_string(theLobBuf=>theLobBuf, theStrBuf=>theStrBuf, theValue=>'"' || TO_CHAR(aNode.dat, 'FXYYYY-MM-DD"T"HH24:MI:SS') || '"');
581584

582585
WHEN json_utils.NODE_TYPE_BOOLEAN THEN
583586
PRAGMA INLINE (boolean_to_json, 'YES');
584-
json_utils.add_string(theLobBuf=>theLobBuf, theStrBuf=>theStrBuf, theValue=>GAP || boolean_to_json(aNode.num));
587+
json_utils.add_string(theLobBuf=>theLobBuf, theStrBuf=>theStrBuf, theValue=>boolean_to_json(aNode.num));
585588

586589
WHEN json_utils.NODE_TYPE_OBJECT THEN
587590
json_utils.object_to_clob(theLobBuf=>theLobBuf, theStrBuf=>theStrBuf, theNodes=>theNodes, theNodeID=>theNodes(theNodeID).sub, theIndentation=>theIndentation, theFlushToLOB=>FALSE);

0 commit comments

Comments
 (0)