Skip to content

Commit 9e4d182

Browse files
fix schema_from_fragment method
1 parent e81a7a8 commit 9e4d182

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/json-schema/validator.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,8 @@ def schema_from_fragment(base_schema, fragment)
101101
end
102102
end
103103

104-
if base_schema.is_a?(Hash)
104+
if !base_schema.is_a?(JSON::Schema)
105105
base_schema = JSON::Schema.new(base_schema, schema_uri, @options[:version])
106-
elsif base_schema.is_a?(Array)
107-
raise JSON::Schema::SchemaError.new("Invalid schema encountered when resolving :fragment option")
108106
end
109107

110108
if @options[:list]

0 commit comments

Comments
 (0)