diff --git a/fhir/resources/STU3/fhirtypes.py b/fhir/resources/STU3/fhirtypes.py index 28ee9d3e..0dda8d3d 100644 --- a/fhir/resources/STU3/fhirtypes.py +++ b/fhir/resources/STU3/fhirtypes.py @@ -371,7 +371,7 @@ class Url(AnyUrl, Primitive): Common URL protocols are http{s}:, ftp:, mailto: and mllp:, though many others are defined""" - path_regex = re.compile(r"^/(?P[^\s?/]+)(/[^\s?/]+)*") + path_regex = re.compile(r"^\/?(?P[^\s?\/]+)(\/[^\s?\/]+)*") __visit_name__ = "url" @classmethod diff --git a/fhir/resources/fhirtypes.py b/fhir/resources/fhirtypes.py index 61c9ef6f..125f2cd7 100644 --- a/fhir/resources/fhirtypes.py +++ b/fhir/resources/fhirtypes.py @@ -371,7 +371,7 @@ class Url(AnyUrl, Primitive): Common URL protocols are http{s}:, ftp:, mailto: and mllp:, though many others are defined""" - path_regex = re.compile(r"^/(?P[^\s?/]+)(/[^\s?/]+)*") + path_regex = re.compile(r"^\/?(?P[^\s?\/]+)(\/[^\s?\/]+)*") __visit_name__ = "url" @classmethod