- Fix not respecting
allow_x00
andcodec
arguments for values in some schemas
- Add new
allow_x00=
andcodec=
arguments tofrom_schema()
, so that you can control generated strings more precisely. - Require hypothesis 6.84+ and jsonschema 4.18+, to support new features and avoid deprecations.
- Requires Python 3.8 or later (3.7 is end-of-life), tested on Python 3.11
- Cache JSON Schema validators by their schema's JSON representation
- never generate trailing newlines for regex patterns ending in
$
(allowed by Python, but not by JSON Schema)
- reduced filtering for object keys (#88)
- updated to
jsonschema >= 4.0.0
(#89); though support forDraft 2019-09
and2020-12
will take longer - requires Python 3.7+, a few months ahead of the 3.6 end of life date
- improved handling for fractional
multipleOf
values
- Allow
custom_formats
for known string formats (#83)
- Fix support
date
andtime
formats (#79)
- PyPy support (#77)
- Generate empty lists when
maxItems > 0
but no elements are allowed (#75) - Correct handling of regex patterns which are invalid in Python (#75)
- Remove internal caching due to hash collisions (#71)
- Improve performance for conditional keywords
- Canonicalise
anyOf
special cases when all subschemas have only thetype
keyword
- Performance improvements from careful caching (#62)
- Use a validator that corresponds to the input schema draft version (#66)
- fixed string schemas with different
format
keywords (#63)
- improved handling of overlapping
items
keywords (#58)
- improved handling of overlapping
dependencies
keywords (#57)
- fixed an internal bug where results incorrectly depended on iteration order (#59)
- Adds a
custom_formats
keyword argument tofrom_schema()
, so that you can specify a strategy to generate strings for custom formats like credit card numbers. Thanks to Dmitry Dygalo, whose sponsorship motivated me to add the feature!
- Substantial performance gains for some schemas, via improved handling of the
contains
,not
,anyOf
, andif/then/else
keywords
- Performance improvement for
object
schemas withadditionalProperties: false
(issue #55)
- Performance improvement for schemas with non-validation keys (such as
description
) - Errors from e.g. invalid schemas are deferred from import time to become failing tests
- Improved handling for some schemas with overlapping non-integer
multipleOf
keys
- Significantly improved efficiency of certain
patternProperties
schemas.
- Fixed several bugs related to interactions between
properties
,patternProperties
, andadditionalProperties
. As a result some strategies will be more efficient than before and others less; and further gains seem likely.
- Improved strategy for
json-pointer
andrelative-json-pointer
string formats - Improved generation of arrays with rarely-satisfied
contains
constraints - Improved canonicalisation and merging of
allOf
schemas
- Performance improvement in calculating schema intersections
- Improved canonicalisation of
uniqueItems: false
case - Improved canonicalisation of numeric schemas
- Reuse
jsonschema
validators during canonicalisation (performance improvement)
- Added a strategy for the
"color"
format - Only apply string length filter when needed (small performance improvement)
- Fixed error in resolution of certain
$ref
\ s - Improved canonicalisation of
anyOf
andcontains
keys
- Requires Hypothesis >= 5.3.0, for improved IP address strategies
- Better canoncialisation of array schemata
- Resolve local, non-recursive references via the
$ref
keyword.
This is the largest feature in a while, and for some schemata it is a breaking change. It's also a fundamental part of the spec, so I'm OK with that!
Note that hypothesis-jsonschema
will raise an explicit error rather than fetching
a remote resource via URI. If think your tests really should hit the network,
get in touch and we can discuss adding an off-by-default option for this.
- Improved canonicalisation of conflicting
minProperties
andmaxProperties
- Explictly reject draft-03 schemata, which are not supported
- More specific type annotations for
from_schema
- Better performance for certain object schemata
enum
schema now shrink to a minimal example rather than the first value listed. This also makes the internals more efficient in certain rare cases.- Improved handling of bounded numeric sub-schemas
- Improved handling of non-integer numeric schemas with
multipleOf
- Improved handling of
not
in many common cases - Improved handling of object schemas with
dependencies
on required keys - Fixed cases where
propertyNames
bans arequired
key
- Improved handling of numeric schemas, especially integer schemas with
multipleOf
. - Bump the minimum version of Hypothesis to ensure that all users have the unique
array bugfix from
0.9.12
. - Fixed a bug where array schemas with an array of
items
,additionalItems: false
, and amaxItems
larger than the number of allowed items would resolve to an invalid strategy.
- Improved internal handling of schemas for arrays which must always be length-zero.
- Fixed RFC 3339 strings generation. Thanks to Dmitry Dygalo for the patch!
- Fixed a bug where equal floats and ints could be generated in a unique array, even though JSONSchema considers 0 === 0.0 (though this may also require an upstream fix to work...)
- Fixed a bug where objects which could have either zero or one properties would always be generated with zero.
- Updated project metadata and development tooling
- Supported and tested on Python 3.8
- Correct handling of
{"items": [...], "uniqueItems": true"}
schemas
- Corrected handling of the
"format"
keyword with unknown values - custom values are allowed by the spec and should be treated as annotations (i.e. ignored).
- Improved canonicalisation, especially for deeply nested schemas.
- A performance optimisation for null and boolean schema,
which relies on a bugfix in
jsonschema >= 3.0.2
.
- Improved handling of the
contains
keyword for arrays
- Improved canonicalisation and merging for a wide range of schemas, which as usual unlocks significant optimisations and performance improvements for cases where they apply.
- Future-proofed canonicalisation of
type
key.
- Better internal canonicalization, which makes current and future optimisations more widely applicable.
- Yet another fix, this time for negative zero and numeric bouds as floats with sub-integer precision. IEEE 754 is tricky, even with Hypothesis!
- Fixes handling of
enum
with elements disallowed by base schema, handling ofif-then-else
with a base schema, and handling of regex patterns that are invalid in Python.
- Fix the fix for numeric schemas with
multipleOf
and exclusive bounds.
- Supports merging schemas for overlapping
patternProperties
, a significant performance improvement in most cases. - If the
"type"
key is missing, it is now inferred from other keys rather than always defaulting to"object"
. - Fixed handling of complicated numeric bounds.
- Improve performance for object schemas where the min and max size can be
further constrained from
properties
andpropertyNames
attributes.
- Supports draft-04 schemata with the latest version of
jsonschema
- Further improved support for
allOf
,oneOf
, andanyOf
with base schemata - Added support for
dependencies
- Handles overlapping
patternProperties
- Now requires
jsonschema
>= 3.0 - Improved support for
allOf
,oneOf
, andpropertyNames
- Supports schemata with
"type": [an array of types]
- Warning-free on Hypothesis 4.11
- Fix continuous delivery configuration (before the latent bug manifested)
- Support for conditional subschemata, i.e. the
if
,then
,else
keywords, and theanyOf
,allOf
,oneOf
, andnot
keywords.
- Works with
jsonschema
3.0 pre-release - Initial support for draft06 and draft07
- Dropped dependency on
canonicaljson
- Less warnings on Python 3.7
- Relicensed under the more permissive Mozilla Public License, like Hypothesis
- Requires Hypothesis version 4.0 or later
- Fixed an array bounds bug with
maxItems
andcontains
keywords
Supports string formats (email, datetime, etc) and simple use of the
"contains"
keyword for arrays.
Good support for all basic types. MVP.
Inference for null, boolean, string, and numeric types.
Stake in the ground (generate arbitrary JSON and filter it!)