python-fastjsonschema icon indicating copy to clipboard operation
python-fastjsonschema copied to clipboard

Custom formats for non-string types

Open n2N8Z opened this issue 5 years ago • 1 comments

AWS publishes JSON Schema documents for its events that include custom formats for non-string types.

e.g.

        "lastModifiedTime": {
          "format": "int64",
          "type": "integer"
        }

These custom formats generate parsing errors in fjs when not defined, but are not used when they are defined.

See full schema for S3 events attached.

[email protected]

n2N8Z avatar Dec 17 '20 16:12 n2N8Z

I see now this has been raised before #100 . The link in the comments https://json-schema.org/understanding-json-schema/reference/string.html#format point out that format only applies to string types, which would make AWS's schema invalid. But the link also mentions "A JSON Schema validator will ignore any format type that it does not understand.". So fjs should ignore "int64".

n2N8Z avatar Dec 17 '20 16:12 n2N8Z

Since 2.19.0 you can pass use_formats=False to disable custom formats.

horejsek avatar Jun 15 '24 14:06 horejsek