diff --git a/src/libfetchers/fetchers.cc b/src/libfetchers/fetchers.cc index a06d931db..0577b8d9d 100644 --- a/src/libfetchers/fetchers.cc +++ b/src/libfetchers/fetchers.cc @@ -419,9 +419,13 @@ namespace nlohmann { using namespace nix; fetchers::PublicKey adl_serializer::from_json(const json & json) { - auto type = optionalValueAt(json, "type").value_or("ssh-ed25519"); - auto key = valueAt(json, "key"); - return fetchers::PublicKey { getString(type), getString(key) }; + fetchers::PublicKey res = { }; + if (auto type = optionalValueAt(json, "type")) + res.type = getString(*type); + + res.key = getString(valueAt(json, "key")); + + return res; } void adl_serializer::to_json(json & json, fetchers::PublicKey p) {