From 2537956503ea982f0fa29f54399677605a60218d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20K=C3=B6gl?= Date: Sun, 6 Jan 2013 10:55:43 +0100 Subject: [PATCH] no leading zeros for array indices, as of draft 08 --- jsonpointer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jsonpointer.py b/jsonpointer.py index b84e958..cbb9137 100644 --- a/jsonpointer.py +++ b/jsonpointer.py @@ -52,8 +52,8 @@ from itertools import tee import re -# array indices must not contain signs, spaces, decimal parts, etc -RE_ARRAY_INDEX=re.compile('^[0-9]+$') +# array indices must not contain leading zeros, signs, spaces, decimals, etc +RE_ARRAY_INDEX=re.compile('0|[1-9][0-9]*$') class JsonPointerException(Exception):