-
-
Notifications
You must be signed in to change notification settings - Fork 242
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
Fix one of logic #70
Fix one of logic #70
Conversation
I noticed that schema.validate wasn't returning true/false consistently when a validation failed. It doesn't seem the contract of the JSON::Schema#validate method is to return true/false. JSON::Schema#validate just defers to JSON::Schema::Validator#validate which always returns the data as opposed to some true/false value.
👍 I had a similar experience with oneOf failing to validate properly and some tests against the version from this pull passed validation when expected. |
👍 I'm having trouble using this because the oneOf logic doesn't work either. It does work against the version from this pull request. "oneOf" functionality is currently broke in 2.1.3. |
oneOf also failed for me on valid input. These changes reported the input valid. |
I don't know where @hoxworth has been. I'm forced to run my fork for now. I would suggest you do the same. Also, if your sample test/input data is different than the test data in this PR, it would be cool if you could post the simplest version of the data and schema just so we have more examples of data. Thanks |
I apologize, I've been AFK for far, far too long. I've recently changed jobs, am expecting a new baby, and I'm lazy (not necessarily in that order!). @apsoto , I apologize for not getting to your PR or anyone else's for that matter. I'd like to take a different approach to make this project a bit more open, and I'd like to add more collaborators with push permission to both the project and to rubygems.org. I'll post a more central announcement on that soon, but if anyone is interested, let me know, and I'll look into adding you. |
@hoxworth - happy to be a part of getting this going again. |
Same issue reported in #90 |
I found some issues with oneOf that wouldn't validate some schemas I was expecting to pass. In trying to get my schemas to pass I ended up refactoring the oneOf attribute's logic.
Existing oneOf tests still pass along with additional tests I added.
See the comment on 8874569 as I believe there is possible future refactoring to be done to make the
JSON::Schema::Validator#validate
method return true/false.