File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,24 @@ that matches some [JSON schema](https://json-schema.org/).
1010The public API consists of just one function: ` hypothesis_jsonschema.from_schema ` ,
1111which takes a JSON schema and returns a strategy for allowed JSON objects.
1212
13+ ``` python
14+ from hypothesis import given
15+ from hypothesis_jsonschema import from_schema
16+
17+ @given (from_schema(
18+ {" type" : " integer" , " minimum" : 1 , " exclusiveMaximum" : 10 }
19+ ))
20+ def test (value ):
21+ assert isinstance (value, int )
22+ assert 1 <= value < 10
23+ ```
24+
25+ For more details on property-based testing and how to use or customise
26+ strategies, [ see the Hypothesis docs] ( https://hypothesis.readthedocs.io/ ) .
27+
1328JSONSchema drafts 04, 05, and 07 are fully tested and working.
1429As of version 0.11, this includes resolving non-recursive references!
1530
16- For details on how to use this strategy in your tests,
17- [ see the Hypothesis docs] ( https://hypothesis.readthedocs.io/ ) .
18-
1931
2032## Supported versions
2133
You can’t perform that action at this time.
0 commit comments