The jsonschema-extended library (JSE) provides an extended version of JSON Schema functionality as provided by the jsonschema
package. JSE by default enables all current and previous format validators (independent of the JSON Schema draft they were introduced or removed for) for the latest draft version, and includes a variety of additional format validators that are not included in the JSON schema spec.
I created JSE to use it in the configuration validation in another project of mine, CleanAB, which requires more "niche" data types to be checked for, as well as default values. The latter is also supported by JSE right out of the box.
- Format validation is enabled by default
- Most formats of all JSON schema draft versions are enabled out-of-the-box (independent of what version they were actually specified in), namely:
- Additonal general purpose formats have been added:
color3
: CSS3 color nameshttp
: HTTP or HTTPS URLshttps
: HTTPS URLs
- Additional niche formats
- Allow generating an end user-friendly representation of a given schema, specifically to document available configuration options with title, description, default, example, etc.
- Add "type-casting" capability for formats that have a python-native type equivalent but are not part provided by JSON itself (e.g. convert
date
format properties todatetime.date
, oruuid
touuid.UUID
, etc.) - Add more common formats and build a comprehensive library of possible formats (I'm planning on accepting PRs or issues for new formats regularly after reaching structural maturity for the project)