From f1c4793de9e0327512f504dbdffd97c446f29133 Mon Sep 17 00:00:00 2001 From: DastInDark <2350416+hitenkoku@users.noreply.github.com> Date: Fri, 12 Jan 2024 02:53:34 +0900 Subject: [PATCH 1/4] fix(utils): fixed json parse error in json input #1248 --- src/main.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index dfa100784..31458eebd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1622,10 +1622,14 @@ impl App { break; } record_cnt += 1; - let mut data = next_rec.unwrap(); // ChannelなどのデータはEvent -> Systemに存在する必要があるが、他処理のことも考え、Event -> EventDataのデータをそのまま投入する形にした。cloneを利用しているのはCopy trait実装がserde_json::Valueにないため - data["Event"]["System"] = data["Event"]["EventData"].clone(); + + if data["Event"]["EventData"].is_object() { + data["Event"]["System"] = data["Event"]["EventData"].clone(); + } else if data["Event"]["EventData"].is_array() { + data["Event"]["System"] = data["Event"]["EventData"].as_array().unwrap()[0].clone(); + } data["Event"]["System"] .as_object_mut() .unwrap() From fefe466f54362f0b11d1ac76b234df751d075060 Mon Sep 17 00:00:00 2001 From: DustInDark <2350416+hitenkoku@users.noreply.github.com> Date: Mon, 15 Jan 2024 10:32:31 +0900 Subject: [PATCH 2/4] style: cargo fmt --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 31458eebd..652860394 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1628,7 +1628,8 @@ impl App { if data["Event"]["EventData"].is_object() { data["Event"]["System"] = data["Event"]["EventData"].clone(); } else if data["Event"]["EventData"].is_array() { - data["Event"]["System"] = data["Event"]["EventData"].as_array().unwrap()[0].clone(); + data["Event"]["System"] = + data["Event"]["EventData"].as_array().unwrap()[0].clone(); } data["Event"]["System"] .as_object_mut() From 320968594ae624bd8b42c54da35ef6418705aea7 Mon Sep 17 00:00:00 2001 From: DastInDark <2350416+hitenkoku@users.noreply.github.com> Date: Fri, 12 Jan 2024 00:58:41 +0900 Subject: [PATCH 3/4] docs(CHANGELOG): added next version changelog template --- CHANGELOG-Japanese.md | 20 +++++++++++++++++++- CHANGELOG.md | 20 +++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/CHANGELOG-Japanese.md b/CHANGELOG-Japanese.md index 0053e330f..12d2795bf 100644 --- a/CHANGELOG-Japanese.md +++ b/CHANGELOG-Japanese.md @@ -1,6 +1,24 @@ # 変更点 -## 2.12.0 [2023/12/23] "SECCON Christmas Release" +## 2.13.0 [2024/XX/XX] "XXX Release" + +**新機能:** + +- XXX + +**改善:** + +- XXX + +**バグ修正:** + +- XXX + +**その他:** + +- XXX + +## 2.12.0 [2023/12/24] "SECCON Christmas Release" **改善:** diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ea858816..16927cb0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,24 @@ # Changes -## 2.12.0 [2023/12/23] "SECCON Christmas Release" +## 2.13.0 [2024/XX/XX] "XXX Release" + +**New Features:** + +- XXX + +**Enhancements:** + +- XXX + +**Bug Fixes:** + +- XXX + +**Other:** + +- XXX + +## 2.12.0 [2023/12/24] "SECCON Christmas Release" **Enhancements:** From 74ef688b5d7a5fd64fdf71f33e6ff06a4bc0ba44 Mon Sep 17 00:00:00 2001 From: DustInDark <2350416+hitenkoku@users.noreply.github.com> Date: Sat, 20 Jan 2024 11:58:18 +0900 Subject: [PATCH 4/4] docs(CHANGELOG): added #1248 --- CHANGELOG-Japanese.md | 2 +- CHANGELOG.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG-Japanese.md b/CHANGELOG-Japanese.md index 12d2795bf..e8649fc34 100644 --- a/CHANGELOG-Japanese.md +++ b/CHANGELOG-Japanese.md @@ -8,7 +8,7 @@ **改善:** -- XXX +- JSON入力でデータが配列内にある場合に解析できるようにした。 (#1248) (@hitenkoku) **バグ修正:** diff --git a/CHANGELOG.md b/CHANGELOG.md index 16927cb0d..dfade3c6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ **Enhancements:** -- XXX +- Added support for parsing JSON input when the data is inside an array. (#1248) (@hitenkoku) **Bug Fixes:**