Skip to content

Commit dc96b0a

Browse files
committed
Add json-pointer format.
1 parent ce22eb5 commit dc96b0a

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

jsonschema/_format.py

+12
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,18 @@ def is_css3_color(instance):
287287
return is_css_color_code(instance)
288288

289289

290+
try:
291+
import jsonpointer
292+
except ImportError:
293+
pass
294+
else:
295+
@_checks_drafts(
296+
draft6="json-pointer", raises=jsonpointer.JsonPointerException,
297+
)
298+
def is_json_pointer(instance):
299+
return jsonpointer.JsonPointer(instance)
300+
301+
290302
draft3_format_checker = FormatChecker(_draft_checkers["draft3"])
291303
draft4_format_checker = FormatChecker(_draft_checkers["draft4"])
292304
draft6_format_checker = FormatChecker(_draft_checkers["draft6"])

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
]
2222

2323
extras_require = {
24-
"format" : ["rfc3987", "strict-rfc3339", "webcolors"],
24+
"format" : ["jsonpointer>1.13", "rfc3987", "strict-rfc3339", "webcolors"],
2525
":python_version=='2.7'": ["functools32"],
2626
}
2727

0 commit comments

Comments
 (0)