You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. Your first schema has "true"s and "false"s in it, so it's not a valid Python JSON Schema. It's also not valid JSON, so it's just malformed. You need to have Python objects (True and False) or load something that's valid JSON.
I don't understand what you mean about the second schema, but that one is valid (and should work in 0.8).
9208016 Merge pull request #67 from iainbeeston/defaults
f57888c Added tests around the default property
db28fee Merge pull request #63 from iainbeeston/patch-1
609944b Added the json-schema ruby gem to the list of libraries using the test suite
git-subtree-dir: json
git-subtree-split: 9208016d04c1b6774d5a17e8b037161873414edb
Hi Julian,
schema1 = {"properties": {"body": {"items": {"required": True, "type": "object", "id": "0", "properties": {"timestamp": {"required": True, "type": "string", "id": "timestamp"}, "params": {"required": "false", "type": "object", "id": "params", "properties": {"Temperature": {"required": "false", "type": "object", "id": "Temperature", "properties": {"value": {"required": "false", "type": "number", "id": "value"}, "unit": {"required": "false", "type": "string", "id": "unit"}}}}}, "location": {"required": True, "type": "object", "id": "location", "properties": {"lat": {"required": True, "type": "number", "id": "lat"}, "lng": {"required": True, "type": "number", "id": "lng"}}}, "nodeid": {"required": True, "type": "string", "id": "nodeid"}}}, "required": True, "type": "array", "id": "body"}, "header": {"type": "object", "properties": {"gatewayid": {"required": True, "type": "string"}, "org": {"required": True, "type": "string"}, "type": {"required": True, "type": "string"}, "seqno": {"required": True, "type": "number"}, "streamid": {"required": True, "type": "string"}}}, "schemakey": {"required": True, "type": "string", "id": "schemakey"}}, "required": True, "type": "object", "id": "datacore0.2", "schema": "http://json-schema.org/draft-03/schema"}
schema2 = {"properties": {"body": {"items": {"required": True, "type": "object", "id": "0", "properties": {"timestamp": {"required": True, "type": "string", "id": "timestamp"}, "params": {"required": True, "type": "object", "id": "params", "properties": {"Temperature": {"required": False, "type": "object", "id": "Temperature", "properties": {"value": {"required": False, "type": "number", "id": "value"}, "unit": {"required": False, "type": "string", "id": "unit"}}}}}, "location": {"required": True, "type": "object", "id": "location", "properties": {"lat": {"required": True, "type": "number", "id": "lat"}, "lng": {"required": True, "type": "number", "id": "lng"}}}, "nodeid": {"required": True, "type": "string", "id": "nodeid"}}}, "required": True, "type": "array", "id": "body"}, "header": {"required": False, "type": "object", "id": "header", "properties": {"gatewayid": {"required": False, "type": "string", "id": "gatewayid"}, "org": {"required": False, "type": "string", "id": "org"}, "streamid": {"required": False, "type": "string", "id": "streamid"}, "type": {"required": False, "type": "string", "id": "type"}, "seqno": {"required": False, "type": "number", "id": "seqno"}}}, "schemakey": {"required": False, "type": "string", "id": "schemakey"}}}
data = {"body": [{"timestamp": "1361273664038", "params": {"Temperature": {"unit": "C", "value": 35.700000000000003}}, "nodeid": "GMR/6L/TS1", "location": {"lat": 13.081, "lng": 80.274000000000001}}], "header": {"gatewayid": "GMT/6L/GW100", "org": "example.com", "streamid": "23", "type": "DATA", "seqno": 1}, "schemakey": "CATGY_221360650604771"}
Could you please resolve if something is really went wrong in schema or in new Schema validator ?
Thanks,
Sakthivel
The text was updated successfully, but these errors were encountered: