Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema validation is broken in master #135

Closed
bkirz opened this issue Oct 13, 2014 · 0 comments · Fixed by #155
Closed

Schema validation is broken in master #135

bkirz opened this issue Oct 13, 2014 · 0 comments · Fixed by #155

Comments

@bkirz
Copy link
Contributor

bkirz commented Oct 13, 2014

It appears to be looking for the metaschema in the wrong place. I suspect (but haven't verified) that it was broken in 47ddd7b since I don't see the previous logic for finding the metaschema relative to the current file included anywhere after the refactor.

Reproduction steps:

~/dev → mkdir new-project
~/dev → cd new-project
~/d/new-project → bundle init
Writing new Gemfile to /Users/benjamin/dev/new-project/Gemfile
~/d/new-project → echo 'gem "json-schema", git: "https://github.com/hoxworth/json-schema.git"' >> Gemfile
~/d/new-project → bundle install
Fetching https://github.com/hoxworth/json-schema.git
Fetching gem metadata from https://rubygems.org/...
Resolving dependencies...
Using json-schema 2.2.5 from https://github.com/hoxworth/json-schema.git (at master)
Using bundler 1.6.3
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
~/d/new-project → bundle exec irb
irb(main):001:0> require 'json-schema'
=> true
irb(main):002:0> JSON::Validator.fully_validate_schema(type: :object, properties: {})
Errno::ENOENT: No such file or directory @ rb_sysopen - /Users/benjamin/dev/new-project/resources/draft-04.json
        from /Users/benjamin/.gem/ruby/2.1.2/bundler/gems/json-schema-909eeffaac23/lib/json-schema/uri/file.rb:31:in `initialize'
        from /Users/benjamin/.gem/ruby/2.1.2/bundler/gems/json-schema-909eeffaac23/lib/json-schema/uri/file.rb:31:in `open'
        from /Users/benjamin/.gem/ruby/2.1.2/bundler/gems/json-schema-909eeffaac23/lib/json-schema/uri/file.rb:31:in `open'
        from /Users/benjamin/.rubies/ruby-2.1.2/lib/ruby/2.1.0/open-uri.rb:34:in `open'
        from /Users/benjamin/.gem/ruby/2.1.2/bundler/gems/json-schema-909eeffaac23/lib/json-schema/validator.rb:513:in `rescue in initialize_schema'
        from /Users/benjamin/.gem/ruby/2.1.2/bundler/gems/json-schema-909eeffaac23/lib/json-schema/validator.rb:492:in `initialize_schema'
        from /Users/benjamin/.gem/ruby/2.1.2/bundler/gems/json-schema-909eeffaac23/lib/json-schema/validator.rb:47:in `block in initialize'
        from /Users/benjamin/.gem/ruby/2.1.2/bundler/gems/json-schema-909eeffaac23/lib/json-schema/validator.rb:47:in `synchronize'
        from /Users/benjamin/.gem/ruby/2.1.2/bundler/gems/json-schema-909eeffaac23/lib/json-schema/validator.rb:47:in `initialize'
        from /Users/benjamin/.gem/ruby/2.1.2/bundler/gems/json-schema-909eeffaac23/lib/json-schema/validator.rb:295:in `new'
        from /Users/benjamin/.gem/ruby/2.1.2/bundler/gems/json-schema-909eeffaac23/lib/json-schema/validator.rb:295:in `fully_validate'
        from /Users/benjamin/.gem/ruby/2.1.2/bundler/gems/json-schema-909eeffaac23/lib/json-schema/validator.rb:302:in `fully_validate_schema'
        from (irb):2
        from /Users/benjamin/.rubies/ruby-2.1.2/bin/irb:11:in `<main>'
@bkirz bkirz changed the title Schema validation is failing in master Schema validation is broken in master Oct 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant