Skip to content

Commit

Permalink
Add json-pointer format.
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian committed Oct 29, 2017
1 parent ce22eb5 commit dc96b0a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions jsonschema/_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,18 @@ def is_css3_color(instance):
return is_css_color_code(instance)


try:
import jsonpointer
except ImportError:
pass
else:
@_checks_drafts(
draft6="json-pointer", raises=jsonpointer.JsonPointerException,
)
def is_json_pointer(instance):
return jsonpointer.JsonPointer(instance)


draft3_format_checker = FormatChecker(_draft_checkers["draft3"])
draft4_format_checker = FormatChecker(_draft_checkers["draft4"])
draft6_format_checker = FormatChecker(_draft_checkers["draft6"])
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
]

extras_require = {
"format" : ["rfc3987", "strict-rfc3339", "webcolors"],
"format" : ["jsonpointer>1.13", "rfc3987", "strict-rfc3339", "webcolors"],
":python_version=='2.7'": ["functools32"],
}

Expand Down

0 comments on commit dc96b0a

Please sign in to comment.