From 9b899b793829ea98ca9e3c5ec969cca03c362c00 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 8 Oct 2026 15:14:34 +0200 Subject: [PATCH] metrics: lift restrictions on fields types These checks stem from a rework from strv to a proper varlink object, but the whole rework's point was to allow more expressive field types, hence drop the unnecessary verification of the string type. (cherry picked from commit fc38a61894bcc772b2bc8d56be9700335cdba181) --- src/shared/metrics.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/shared/metrics.c b/src/shared/metrics.c index 68b18895b4..dbb3f7abd0 100644 --- a/src/shared/metrics.c +++ b/src/shared/metrics.c @@ -161,14 +161,7 @@ static int metric_build_send( assert(link); assert(value); - if (fields) { - assert(sd_json_variant_is_object(fields)); - - _unused_ const char *k; - _unused_ sd_json_variant *e; - JSON_VARIANT_OBJECT_FOREACH(k, e, fields) - assert(sd_json_variant_is_string(e)); - } + assert(!fields || sd_json_variant_is_object(fields)); return sd_varlink_replybo( link,