From 268d59e6612b57685d5641e0afbe38b96a5a0114 Mon Sep 17 00:00:00 2001 From: Tom Reitz Date: Mon, 6 May 2024 12:45:12 -0500 Subject: [PATCH] fixes a bug with validating local descriptor values within nested payloads --- lightbeam/validate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lightbeam/validate.py b/lightbeam/validate.py index e24aa08..b6ffb7f 100644 --- a/lightbeam/validate.py +++ b/lightbeam/validate.py @@ -114,11 +114,11 @@ def load_local_descriptors(self): def has_invalid_descriptor_values(self, payload, local_descriptors, path=""): for k in payload.keys(): if isinstance(payload[k], dict): - value = self.has_invalid_descriptor_values(payload[k], path+("." if path!="" else "")+k) + value = self.has_invalid_descriptor_values(payload[k], local_descriptors, path+("." if path!="" else "")+k) if value!="": return value elif isinstance(payload[k], list): for i in range(0, len(payload[k])): - value = self.has_invalid_descriptor_values(payload[k][i], path+("." if path!="" else "")+k+"["+str(i)+"]") + value = self.has_invalid_descriptor_values(payload[k][i], local_descriptors, path+("." if path!="" else "")+k+"["+str(i)+"]") if value!="": return value elif isinstance(payload[k], str) and k.endswith("Descriptor"): namespace = payload[k].split("#")[0]