From e689032c31b0144c76b348a8d7351ad89aafc9f0 Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Fri, 12 Apr 2019 14:34:25 +0200
Subject: [PATCH] fix bug in 3947903f3352a6787deeb5e47e7ebe17a9615109

---
 src/Shocks.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/Shocks.cc b/src/Shocks.cc
index 3225c687..5e323829 100644
--- a/src/Shocks.cc
+++ b/src/Shocks.cc
@@ -639,7 +639,7 @@ ShockGroupsStatement::writeOutput(ostream &output, const string &basename, bool
 void
 ShockGroupsStatement::writeJsonOutput(ostream &output) const
 {
-  output << R"({"statementName": "shock_groups", "name": ")" << name << R"(", "groups": {)";
+  output << R"({"statementName": "shock_groups", "name": ")" << name << R"(", "groups": [)";
   bool unique_label = true;
   bool printed_group = false;
   for (auto it = shock_groups.begin(); it != shock_groups.end(); it++, unique_label = true)
@@ -657,7 +657,7 @@ ShockGroupsStatement::writeJsonOutput(ostream &output) const
             output << ", ";
           else
             printed_group = true;
-          output << R"("group_name": ")" << it->name << R"(",)"
+          output << R"({"group_name": ")" << it->name << R"(",)"
                  << R"("shocks": [)";
           for (auto it1 = it->list.begin(); it1 != it->list.end(); it1++)
             {
@@ -665,8 +665,8 @@ ShockGroupsStatement::writeJsonOutput(ostream &output) const
                 output << ", ";
               output << R"(")" << *it1 << R"(")";
             }
-          output << "]";
+          output << "]}";
         }
     }
-  output << "}}";
+  output << "]}";
 }
-- 
GitLab