Skip to content

Commit

Permalink
Do not override schema validator
Browse files Browse the repository at this point in the history
  • Loading branch information
pd committed Nov 4, 2014
1 parent 7580f0f commit 26e2582
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/json-schema/validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def build_schemas(parent_schema)
def handle_schema(parent_schema, obj)
if obj.is_a?(Hash)
schema_uri = parent_schema.uri.clone
schema = JSON::Schema.new(obj,schema_uri,parent_schema.validator)
schema = JSON::Schema.new(obj, schema_uri, parent_schema.validator)
if obj['id']
Validator.add_schema(schema)
end
Expand Down Expand Up @@ -529,7 +529,6 @@ def initialize_schema(schema)
schema_uri = normalized_uri(schema)
if Validator.schemas[schema_uri.to_s].nil?
schema = @options[:schema_loader].load(schema_uri)
schema.validator = @options[:version] # wtf?

if @options[:list] && @options[:fragment].nil?
schema = schema.to_array_schema
Expand Down

0 comments on commit 26e2582

Please sign in to comment.