diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d3352bdd..8df86609 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,12 @@ +v4.17.2 +======= + +* Empty strings are not valid relative JSON Pointers (aren't valid under the + RJP format). +* Durations without (trailing) units are not valid durations (aren't + valid under the duration format). This involves changing the dependency + used for validating durations (from ``isoduration`` to ``isodate``). + v4.17.1 ======= diff --git a/jsonschema/_format.py b/jsonschema/_format.py index 5e483269..5ec97977 100644 --- a/jsonschema/_format.py +++ b/jsonschema/_format.py @@ -501,7 +501,9 @@ def is_uri_template(instance: object) -> bool: def is_duration(instance: object) -> bool: if not isinstance(instance, str): return True - return bool(isoduration.parse_duration(instance)) + isoduration.parse_duration(instance) + # FIXME: See bolsote/isoduration#25 and bolsote/isoduration#21 + return instance.endswith(tuple("DMYWHMS")) @_checks_drafts(