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

UUID class conflict #9

Closed
oruen opened this issue May 3, 2011 · 2 comments
Closed

UUID class conflict #9

oruen opened this issue May 3, 2011 · 2 comments

Comments

@oruen
Copy link
Contributor

oruen commented May 3, 2011

After adding uuid gem into my project, I've run into an issue with json-schema builtin UUID class.
Both uuid gem and json-scheme uri/uuid file declare class with the same name - UUID. Uuid gem being included after json-schema gem overrides initialize method with one without any arguments - https://github.com/assaf/uuid/blob/master/lib/uuid.rb#L249

So running Validator.validate! an ArgumentError occures at https://github.com/hoxworth/json-schema/blob/master/lib/json-schema/uri/uuid.rb#L80

There may be workaround by including uuidtools gem, however I think json-schema gem should use a namespace for UUID class.

@oruen
Copy link
Contributor Author

oruen commented May 3, 2011

Btw, rescuing all descendants of StandardError here https://github.com/hoxworth/json-schema/blob/master/lib/json-schema/validator.rb#L331 made it harder to find the original error.

@hoxworth
Copy link
Contributor

hoxworth commented May 3, 2011

Thanks - I added a namespace around this UUID class to avoid any further clobbering. As for the StandardError rescue, I left that open to catch different types of error messages thrown by different JSON backends - however, that does seem to be a little bit of an overkill, so I'll look at a better way to do it.

Fixed in 86953a8.

@hoxworth hoxworth closed this as completed May 3, 2011
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

No branches or pull requests

2 participants