diff --git a/lib/json-schema/validator.rb b/lib/json-schema/validator.rb index afd90b30..2e4da42f 100644 --- a/lib/json-schema/validator.rb +++ b/lib/json-schema/validator.rb @@ -134,7 +134,7 @@ def load_ref_schema(parent_schema, ref) end def absolutize_ref_uri(ref, parent_schema_uri) - ref_uri = URI.parse(ref) + ref_uri = Addressable::URI.parse(ref) return ref_uri if ref_uri.absolute? # This is a self reference and thus the schema does not need to be re-loaded @@ -142,7 +142,7 @@ def absolutize_ref_uri(ref, parent_schema_uri) uri = parent_schema_uri.clone uri.fragment = '' - uri.merge(Pathname(ref_uri.path).cleanpath.to_s) + uri.join(ref_uri.path) end # Build all schemas with IDs, mapping out the namespace @@ -589,6 +589,5 @@ def normalized_uri(data) end uri end - end end diff --git a/test/data/file with spaces.json b/test/data/file with spaces.json deleted file mode 100644 index 18534a57..00000000 --- a/test/data/file with spaces.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name" : "john" -}