Skip to main content

Strictly checks that a json schema is valid

Project description


Build Status codecov

Because soft validation is not enough


JSON schema standard and its implementations stand that if you have something unfamiliar in your schema, it's not an error. In particular, you won't get an error if you made a typo or used something you thought as working. For example, this one is perfectly fine and valid:

    "required": ["company"],
    "type": "object",
    "propertie": {"company": {"pattern": "^(Apple)$"}, "format": "url"},

But we want to catch those propertie typos and invalid url formats.

The library rely on jsonschema and supports additional keywords to ignore.


Derives the draft from the schema and yields a jsonschema.SchemaError if:

  • A schema is empty
  • A schema contains a keyword which is not a part of a jsonschema implementation or extended_keywords set
  • A schema contains an invalid format value
  • A schema fails with jsonschema.check_schema()


from perfect-jsonschema import check

    check(schema, extended_keywords={"tag"})
except Exception as e:

An exception example:

Traceback (most recent call last):
    f"Schema contains invalid keywords for "
jsonschema.exceptions.SchemaError: Schema contains invalid keywords for
{'propertie', 'company'}

Local development

pipenv install --dev
pipenv shell


Any contribution is welcome

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

perfect-jsonschema-2019.2.6.tar.gz (11.7 kB view hashes)

Uploaded Source

Built Distribution

perfect_jsonschema-2019.2.6-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page