#!/usr/bin/env ruby
require "json_schema"
json = { "maximum" => 1 }
schema = ::JsonSchema.parse!(json)
json_pointer = "#/maximum"
p ::JsonPointer::Evaluator.new(json).evaluate(json_pointer)
begin
p ::JsonPointer::Evaluator.new(schema).evaluate(json_pointer)
rescue => e
p e
end
p ::JsonPointer::Evaluator.new(schema).evaluate("#/max")
,and it results
1
#<NoMethodError: Schema does not respond to #maximum>
1
That is because ::JsonSchema::Schema does not respond to maximum but responds to max.
I suppose it might work if it has aliases, maximum, maximum=, exclusiveMaximum, and so on.
,and it results
That is because
::JsonSchema::Schema
does not respond to maximum but responds to max.I suppose it might work if it has aliases, maximum, maximum=, exclusiveMaximum, and so on.