From 3930fa41a1f43e90e2663d0ba40691647655ec6c Mon Sep 17 00:00:00 2001 From: Alberto Sartori Date: Wed, 8 Nov 2023 17:38:00 +0100 Subject: artifact.hpp: make ToJson and FromJson consistent The function ToJson used `file_type` key to express the type of the artifact, on the other hand, FromJson was expecting `type`. This patch makes the two functions consistent, prefering `file_type` for historical reasons. --- src/buildtool/common/artifact.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/buildtool/common/artifact.hpp b/src/buildtool/common/artifact.hpp index 3a593f5b..76bb1c9f 100644 --- a/src/buildtool/common/artifact.hpp +++ b/src/buildtool/common/artifact.hpp @@ -98,9 +98,9 @@ class Artifact { [[nodiscard]] static auto FromJson(nlohmann::json const& j) -> std::optional { if (j.is_object() and j["id"].is_string() and - j["size"].is_number() and j["type"].is_string()) { + j["size"].is_number() and j["file_type"].is_string()) { auto const& object_type = - FromChar(*(j["type"].get().c_str())); + FromChar(*(j["file_type"].get().c_str())); return ObjectInfo{ .digest = ArtifactDigest{j["id"].get(), j["size"].get(), -- cgit v1.2.3