We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 49960a0 + 8d28228 commit bb722dbCopy full SHA for bb722db
fastjsonschema/__init__.py
@@ -72,6 +72,33 @@
72
* JSON schema says you can use keyword ``default`` for providing default values. This implementation
73
uses that and always returns transformed input data.
74
75
+Usage
76
+*****
77
+
78
+.. code-block:: python
79
80
+ import fastjsonschema
81
82
+ point_schema = {
83
+ "type": "object",
84
+ "properties": {
85
+ "x": {
86
+ "type": "number",
87
+ },
88
+ "y": {
89
90
91
92
+ "required": ["x", "y"],
93
+ "additionalProperties": False,
94
+ }
95
96
+ point_validator = fastjsonschema.compile(point_schema)
97
+ try:
98
+ point_validator({"x": 1.0, "y": 2.0})
99
+ except fastjsonschema.JsonSchemaException as e:
100
+ print(f"Data failed validation: {e}")
101
102
API
103
***
104
"""
0 commit comments