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

NameError: uninitialized constant JSON::Validator::SchemaParseError #292

Closed
emil-rb opened this issue Jan 13, 2016 · 2 comments · Fixed by #293
Closed

NameError: uninitialized constant JSON::Validator::SchemaParseError #292

emil-rb opened this issue Jan 13, 2016 · 2 comments · Fixed by #293

Comments

@emil-rb
Copy link

emil-rb commented Jan 13, 2016

When one passes an object, instead of a valid schema to the library it throws

NameError:
       uninitialized constant JSON::Validator::SchemaParseError

This seems to be because SchemaParseError is under JSON::Schema, while the call site is in JSON::Validator.

See lib/json-schema/validator.rb, line 572 for the call site.

iainbeeston pushed a commit to iainbeeston/json-schema that referenced this issue Jan 14, 2016
If you pass an unrecognized object for the schema, we should be raising a SchemaParseError, however instead right now a NameError is raised, beacuse we're not correctly qualifying the error class with it's module.

I've corrected the class/module name and added tests.

This fixes voxpupuli#292
@iainbeeston
Copy link
Contributor

Thanks for reporting that, I've just raised a pull request to fix it.

@emil-rb
Copy link
Author

emil-rb commented Jan 14, 2016

Thanks for the quick action.

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.

2 participants