Skip to content

Commit 812782f

Browse files
committed
Merge pull request #37 from shakeelmohamed/feature/rfc3986
Replace rfc3987 with rfc3986 - issue #36
2 parents 2b41d09 + 78063be commit 812782f

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,4 @@ target/
6464
*.sublime-workspace
6565
shippable/*
6666
/docs/site
67+
.python-version

Diff for: jsontableschema/types.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import binascii
1717
import uuid
1818
from dateutil.parser import parse as date_parse
19-
import rfc3987
19+
from rfc3986 import is_valid_uri
2020
import unicodedata
2121
import jsonschema
2222
from future.utils import raise_with_traceback
@@ -161,11 +161,9 @@ def cast_email(self, value):
161161
def cast_uri(self, value):
162162
if not self._type_check(value):
163163
return False
164-
165-
try:
166-
rfc3987.parse(value, rule="URI")
164+
if is_valid_uri(value, require_scheme=True):
167165
return value
168-
except ValueError:
166+
else:
169167
raise exceptions.InvalidURI('{0} is not a valid uri'.format(value))
170168

171169
def cast_binary(self, value):

Diff for: requirements/base.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
click>=3.3
22
requests>=2.5.1
33
python-dateutil>=2.4.0
4-
rfc3987>=1.3.4
4+
rfc3986>=0.3.0
55
jsonschema>=2.5.1
66
future>=0.15.2

Diff for: setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
'click>=3.3',
4040
'requests>=2.5.1',
4141
'python-dateutil>=2.4.0',
42-
'rfc3987>=1.3.4',
42+
'rfc3986>=0.3.0',
4343
'jsonschema>=2.5.1',
4444
'future>=0.15.2'
4545
]

0 commit comments

Comments
 (0)