Skip to content

Fix #93 ($ref to local definition not working) #119

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

Closed
wants to merge 5 commits into from

Conversation

co3k
Copy link

@co3k co3k commented Nov 20, 2014

See also #110. This pull request is based @stoiev's branch. First, thanks for his great work!
(I skipped fc947a6 commit. Because it is not related with this problem and it contains some problems; composer.lock should not be ignored (see http://blog.naderman.de/2014/02/17/replace-conflict-forks-explained/) and netbeans project directories should be ignored in $HOME/.gitignore)

And I've referenced some implementation of brandur/json_schema (it is Ruby JSON Schema validation library). I really appreciate to the library.

My fix resolves some problems of #110; e.g. the #110 implementation only resolves the top level of $ref but my implementation resolves any level of a path.

But, however, it doesn't pass json/tests/draft4/ref.json yet. We should effort resolve this problem too, but the inline dereferencing problem is needed to fix ASAP.

@co3k
Copy link
Author

co3k commented Nov 20, 2014

Oops, my patch doesn't consider PHP 5.3.x.

@bighappyface
Copy link
Collaborator

@co3k Both "ref" tests provided by the schema test suite are already included:

https://github.com/co3k/json-schema/blob/2450d219d374861f734ff559d876bdcb19367793/tests/JsonSchema/Tests/Drafts/Draft4Test.php#L21-L22

Is everything already passing without testInnerDefinitions? It would be preferable to rely on the test suite only for verification.

@bighappyface
Copy link
Collaborator

@co3k I have removed ref.json from the getSkippedTests array and, even with this PR patch applied, the same 8 tests failing today are still failing. One of the failing tests should be passing if the inner refs are resolving correctly:

https://github.com/json-schema/JSON-Schema-Test-Suite/blob/1.1.0/tests/draft4/ref.json#L105-L127

I think you can remove testInnerDefinitions in favor of leveraging the official test suite so that we can confirm all expected draft04 functionality and behavior is present. This PR is important (I need functionality to work too) and focusing on that ref.json test suite will give us 8x more tests around $ref resolution.

@araines
Copy link

araines commented Aug 15, 2015

@bighappyface: I'm pretty sure the reason the official test suite is not working at the moment is because the resolver isn't brought in to play at all during that official test run. Therefore the tests will fail. I'm going to keep digging and see what I can find out about this, because this is definitely an issue that needs resolving with this package.

@bighappyface
Copy link
Collaborator

@araines thanks for the feedback and PR. When I tried out the tests locally, I setup the ref resolver as you described although I may not have made it clear. What I was getting at was the lack of comprehensive testing following the established test suites.

I'm checking out your PR now.

@bighappyface
Copy link
Collaborator

Closing in favor of #182

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.

3 participants