diff --git a/pykwalify/rule.py b/pykwalify/rule.py index f044b69..666461b 100644 --- a/pykwalify/rule.py +++ b/pykwalify/rule.py @@ -1149,7 +1149,7 @@ def init_mapping_value(self, v, rule, path): v = {} # Check if this is a regex rule. Handle specially - if k.startswith("regex;") or k.startswith("re;"): + if str(k).startswith("regex;") or str(k).startswith("re;"): log.debug(u"Found regex map rule") regex = k.split(";", 1) if len(regex) != 2: diff --git a/tests/files/success/test_mapping.yaml b/tests/files/success/test_mapping.yaml index 22656f9..a300843 100644 --- a/tests/files/success/test_mapping.yaml +++ b/tests/files/success/test_mapping.yaml @@ -321,3 +321,17 @@ schema: mapping: regex;(.+): type: str +--- +name: mapping20 +desc: Test mapping with integer keys +data: + test: + 0: test +schema: + type: map + mapping: + test: + type: map + mapping: + 0: + type: str