Closed triplepointfive closed 8 years ago
I can reproduce this by doing the following:
require 'json-schema'
MultiJson.use :json_common
JSON::Validator.fully_validate_schema( {} ) # => raises a NameError
Unfortunately this is a bug with the :json_common
adapter in MultiJson, rather than a problem with json-schema itself. I've raised an issue on the MultiJson repository for it.
A workaround for now would be to not use the :json_common
MultiJson adapter (for example, use :json_gem
) or not to use MultiJson with json-schema
@rwz has informed me that :json_common
isn't an adapter you should be using - perhaps changing the MultiJson adapter for your app will resolve the issue
I actually just downgraded to v2.5.2 and that's fixed the issue. That's why I suspected json-schema. Anyway, thank you for your investigation.
Calling
JSON::Validator.fully_validate_schema( {"$schema"=>"http://json-schema.org/draft-03/schema#", "type"=>"object", "properties"=>{}} )
Leads toJSON::ParserError: invalid comment format at line 1, column 1 [parse.c:96]
But the same result even with
JSON::Validator.fully_validate_schema( {} )
This is happening because the first arg of
MultiJSON.load
is"/Users/Smelkov/.rvm/gems/ruby-2.2.3@ege-fcc-ash/gems/json-schema-2.5.2/resources/draft-04.json"
, not the content of file itselfBacktrace: