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

Fix one of logic #70

Merged
merged 2 commits into from
Dec 31, 2013
Merged

Fix one of logic #70

merged 2 commits into from
Dec 31, 2013

Conversation

apsoto
Copy link
Contributor

@apsoto apsoto commented Aug 6, 2013

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.

apsoto added 2 commits August 5, 2013 17:59
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.
@matt-glover
Copy link

👍 I had a similar experience with oneOf failing to validate properly and some tests against the version from this pull passed validation when expected.

@dkowis
Copy link

dkowis commented Oct 23, 2013

👍 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.

@pwillett
Copy link

pwillett commented Dec 6, 2013

oneOf also failed for me on valid input. These changes reported the input valid.

@apsoto
Copy link
Contributor Author

apsoto commented Dec 6, 2013

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

@hoxworth
Copy link
Contributor

hoxworth commented Dec 6, 2013

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.

@myitcv
Copy link

myitcv commented Dec 7, 2013

@hoxworth - happy to be a part of getting this going again.

@myitcv myitcv mentioned this pull request Dec 7, 2013
@myitcv
Copy link

myitcv commented Dec 7, 2013

Same issue reported in #90

hoxworth added a commit that referenced this pull request Dec 31, 2013
@hoxworth hoxworth merged commit 3022c73 into voxpupuli:master Dec 31, 2013
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 this pull request may close these issues.

6 participants