Skip to content

date-time format checker is ISO8601, not RFC3339 #115

@mfenniak

Description

@mfenniak

The format checker for the "date-time" format accepts ISO8601 date-time formats, whereas the JSON-Schema spec says that it should validate RFC3339 date-time format. RFC3339 is a limited subset of ISO8601 (and far easier to parse correctly).

For example, the current "date-time" checker accepts: "2013-350T01:01:01" as a valid date-time; this would be 1 minute and 1 second past 1am on the 350th day of 2013 in ISO8601 format, but it's an invalid string in RFC3339.

>>> jsonschema.FormatChecker().conforms("2013-350T01:01:01", "date-time")
True

The effect of this issue is that records passing the "date-time" format check might subsequently not be parseable as RFC3339 dates.

By the way, thanks for authoring jsonschema. It's a great library! 👍

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions