From d44c2abd0fe202f87f0e88d20fac2e19b391dcb7 Mon Sep 17 00:00:00 2001 From: Trey Darley Date: Tue, 26 Jun 2018 09:23:52 +0000 Subject: [PATCH] 2.1 spec (somewhat inexplicably) limits dict keys to 250 chars --- stix2/v21/properties.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stix2/v21/properties.py b/stix2/v21/properties.py index 935a984..796a5cb 100644 --- a/stix2/v21/properties.py +++ b/stix2/v21/properties.py @@ -241,8 +241,8 @@ class DictionaryProperty(Property): raise ValueError("The dictionary property must contain a non-empty dictionary") for k in dictified.keys(): - if len(k) > 256: - raise DictionaryKeyError(k, "longer than 256 characters") + if len(k) > 250: + raise DictionaryKeyError(k, "longer than 250 characters") if not re.match('^[a-zA-Z0-9_-]+$', k): raise DictionaryKeyError(k, "contains characters other than" "lowercase a-z, uppercase A-Z, "