Skip to main content

Generate test data from JSON schemata with Hypothesis

Project description

hypothesis-jsonschema

A Hypothesis strategy for generating data that matches some JSON schema.

Here's the PyPI page.

API

The public API consists of just one function: hypothesis_jsonschema.from_schema, which takes a JSON schema and returns a strategy for allowed JSON objects.

JSONSchema drafts 04, 05, and 07 are fully tested and working. As of version 0.11, this includes resolving non-recursive references!

For details on how to use this strategy in your tests, see the Hypothesis docs.

Supported versions

hypothesis-jsonschema requires Python 3.6 or later. In general, 0.x versions will require very recent versions of all dependencies because I don't want to deal with compatibility workarounds.

hypothesis-jsonschema may make backwards-incompatible changes at any time before version 1.x - that's what semver means! - but I've kept the API surface small enough that this should be avoidable. The main source of breaks will be if or when schema that never really worked turn into explicit errors instead of generating values that don't quite match.

You can sponsor me to get priority support, roadmap input, and prioritized feature development.

Contributing to hypothesis-jsonschema

We love external contributions - and try to make them both easy and fun. You can read more details in our contributing guide, and see everyone who has contributed on GitHub. Thanks, everyone!

Changelog

Patch notes can be found in CHANGELOG.md.

Security contact information

To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.

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

hypothesis-jsonschema-0.15.0.tar.gz (25.9 kB view details)

Uploaded Source

Built Distribution

hypothesis_jsonschema-0.15.0-py3-none-any.whl (22.9 kB view details)

Uploaded Python 3

File details

Details for the file hypothesis-jsonschema-0.15.0.tar.gz.

File metadata

  • Download URL: hypothesis-jsonschema-0.15.0.tar.gz
  • Upload date:
  • Size: 25.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for hypothesis-jsonschema-0.15.0.tar.gz
Algorithm Hash digest
SHA256 8ef55756f00ac8bc34a48b6b7d516468e7f7da3edf4f8eeee324b2e39071c042
MD5 63812985a7925a9755a7c551a3a55a0d
BLAKE2b-256 2469b36bcf49ea64eaa550f61cf2408d9f2c9167aa37ba7aed6021277996e00c

See more details on using hashes here.

Provenance

File details

Details for the file hypothesis_jsonschema-0.15.0-py3-none-any.whl.

File metadata

  • Download URL: hypothesis_jsonschema-0.15.0-py3-none-any.whl
  • Upload date:
  • Size: 22.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for hypothesis_jsonschema-0.15.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e312c6c959730bd86ae684a808aa2d471aec4f32988ebfced98752afa2532dd4
MD5 c8e3f7014809f4becab45ba6cdd9eb46
BLAKE2b-256 289c6c9c45899372c3f9f4659e9b647b89d49676012658e3196d2aa49522d54a

See more details on using hashes here.

Provenance

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