Skip to content

Commit

Permalink
Adjustments to refactored URI building/fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
RST-J committed Nov 7, 2014
1 parent 3ea70e5 commit c442f1d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 2 additions & 3 deletions lib/json-schema/validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@ 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
return parent_schema_uri if ref_uri.path.empty?

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
Expand Down Expand Up @@ -589,6 +589,5 @@ def normalized_uri(data)
end
uri
end

end
end
3 changes: 0 additions & 3 deletions test/data/file with spaces.json

This file was deleted.

0 comments on commit c442f1d

Please sign in to comment.