schema = json.loads(
    """{
  "$schema": "http://json-schema.org/schema#",
  "description": "Schemas for heading: either a number within [0, 360) or null.",
  "title": "Tester for number-or-null schema",
  "properties": {
    "heading": {
      "type": ["number", "null"],
      "exclusiveMinimum": false,
      "exclusiveMaximum": true,
      "minimum": 0,
      "maximum": 360
    }
  }
}"""
    )
inputs = [{'heading': 5}, {'heading': 0}, {'heading': 360}, {'heading': 
    360.1}, {'heading': -5}, {'heading': None}, {'heading': False}, {
    'heading': 'X'}, json.loads('{"heading":12}'), json.loads(
    '{"heading":120}'), json.loads('{"heading":1200}'), json.loads(
    '{"heading":false}'), json.loads('{"heading":null}')]
for input in inputs:
    pass
JSON Schema: validate a number-or-null value