Browse Source

Workaround a bug in pyjsonschema.

Not sure it's a bug but still it seems that the Draft4Validator
expects the "id" being replaced with "$id" althoug it should be only
true with Draft6Validator according to this:
https://json-schema.org/draft-06/json-schema-release-notes.html#q-what-are-the-changes-between-draft-04-and-draft-06
pitchum 6 years ago
parent
commit
4f6abbda3b

+ 1 - 1
ispformat/schema/0.1/isp.json

@@ -1,6 +1,6 @@
 {
     "$schema": "http://json-schema.org/draft-04/schema#",
-    "id": "http://ffdn.org/ispschema/draft-01/schema#",
+    "$sid": "http://ffdn.org/ispschema/draft-01/schema#",
     "title": "ISP",
     "description": "Object describing a local ISP",
     "type": "object",

+ 1 - 1
ispformat/schema/0.2/isp.json

@@ -1,6 +1,6 @@
 {
     "$schema": "http://json-schema.org/draft-04/schema#",
-    "id": "http://ffdn.org/ispschema/draft-01/schema#",
+    "$id": "http://ffdn.org/ispschema/draft-01/schema#",
     "title": "ISP",
     "description": "Object describing a local ISP",
     "type": "object",

+ 1 - 1
ispformat/validator/schemavalidator.py

@@ -9,7 +9,7 @@ from urlparse import urlsplit
 class MyRefResolver(RefResolver):
     def resolve_remote(self, uri):
         # Prevent remote resolving
-        raise RefResolutionError("LOL NOPE")
+        raise RefResolutionError("Refusing to resolve remote URI: '{}'".format(uri))
 
 
 geojson_allowed_types=('Polygon', 'MultiPolygon')