Skip to content

Commit d36c903

Browse files
authored
Merge pull request #53 from edanalytics/fix/validate_descriptor_values_without_hash_char
fix `validate` of descriptor values without a hash char (`#`)
2 parents 0e839be + 3089e6a commit d36c903

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lightbeam/validate.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,8 @@ def has_invalid_descriptor_values(self, payload, path=""):
344344
value = self.has_invalid_descriptor_values(payload[k][i], path+("." if path!="" else "")+k+"["+str(i)+"]")
345345
if value!="": return value
346346
elif isinstance(payload[k], str) and k.endswith("Descriptor"):
347+
if "#" not in payload[k]:
348+
return payload[k] + f" is not a valid descriptor value for {k}" + (" (at " + path + ")" if path!="" else "") + "; format should be like `uri://namespace.org/SomeDescriptor#SomeValue`"
347349
namespace = payload[k].split("#")[0]
348350
codeValue = payload[k].split("#")[1]
349351
# check if it's a local descriptor:

0 commit comments

Comments
 (0)