We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e4d3499 commit 1d7675eCopy full SHA for 1d7675e
lib/json-schema/schema.rb
@@ -6,7 +6,11 @@ class Schema
6
attr_accessor :schema, :uri, :validator
7
8
def initialize(schema,uri,parent_validator=nil)
9
- @schema = schema
+ unless schema.respond_to?(:to_hash)
10
+ raise ArgumentError, "schema must be a hash; got: #{schema.inspect}"
11
+ end
12
+
13
+ @schema = schema.to_hash
14
@uri = uri
15
16
# If there is an ID on this schema, use it to generate the URI
0 commit comments