Skip to content

Instantly share code, notes, and snippets.

@netmanchris
Last active May 16, 2017 20:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save netmanchris/81e24ec1b1ac6f4af10a077282492627 to your computer and use it in GitHub Desktop.
Save netmanchris/81e24ec1b1ac6f4af10a077282492627 to your computer and use it in GitHub Desktop.
bad_vlan_json_schema.py
validate(vlan_bad, schema)
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jsonschema/validators.py", line 541, in validate
cls(schema, *args, **kwargs).validate(instance)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jsonschema/validators.py", line 130, in validate
raise error
jsonschema.exceptions.ValidationError: 5000 is greater than the maximum of 4094
Failed validating 'maximum' in schema['properties']['vlan_id']:
{'description': 'The unique ID of the VLAN. IEEE 802.1Q VLAN '
'identifier (VID)',
'maximum': 4094,
'minimum': 1,
'sql.not_null': True,
'type': 'integer'}
On instance['vlan_id']:
5000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment