-
Notifications
You must be signed in to change notification settings - Fork 356
Add proper recursive handling for $ref resolution base #448
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
Merged
bighappyface
merged 1 commit into
jsonrainbow:6.0.0-dev
from
erayd:bugfix-447-id-relative-ref
Oct 2, 2017
Merged
Add proper recursive handling for $ref resolution base #448
bighappyface
merged 1 commit into
jsonrainbow:6.0.0-dev
from
erayd:bugfix-447-id-relative-ref
Oct 2, 2017
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@shmax Any chance of a code review? |
eea58bd
to
b639049
Compare
LGTM 💯 |
Fixes jsonrainbow#447 Note that this patch does not check whether a given container is actually a schema when recursing into it. In most cases this will not matter, however it does mean that in some edge cases it will attempt to resolve a `$ref` in a context where ref is actually not part of the spec. Limiting resolution to schema-context containers is outside the scope of this patch, but can be added later.
b639049
to
737facf
Compare
Rebased. |
bighappyface
approved these changes
Oct 2, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for 737facf
erayd
added a commit
to erayd/json-schema
that referenced
this pull request
Oct 3, 2017
Fixes jsonrainbow#447 Note that this patch does not check whether a given container is actually a schema when recursing into it. In most cases this will not matter, however it does mean that in some edge cases it will attempt to resolve a `$ref` in a context where ref is actually not part of the spec. Limiting resolution to schema-context containers is outside the scope of this patch, but can be added later.
bighappyface
pushed a commit
that referenced
this pull request
Oct 3, 2017
* Update php-csfixer rules to address problem in 2.7 & new multiline rule (#449) * Update php-csfixer rules to address problem in 2.7 & new multiline rule * yoda_style in 2.7 is dangerous and may result in logic errors. In some cases, it also results in invalid syntax. * multiline comments prefixed with // now seem to be misaligned, and this cannot be disabled, so have changed the relevant comment. * PHP-5.3 is not available on trusty, so explicitly specify precise for 5.3 * Add proper recursive handling for $ref resolution base (#448) Fixes #447 Note that this patch does not check whether a given container is actually a schema when recursing into it. In most cases this will not matter, however it does mean that in some edge cases it will attempt to resolve a `$ref` in a context where ref is actually not part of the spec. Limiting resolution to schema-context containers is outside the scope of this patch, but can be added later.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Implement recursive resolution of
$ref
base.Why
Because the existing code doesn't actually do this properly, and is various combinations of missing and not implemented in this area.
Note that this patch does not distinguish between schema and non-schema contexts; it just resolves
$ref
wherever it may occur within a schema. Limiting this to schema-context only may be added later.ObjectIterator
is not removed, despite now being redundant, as it's a handy class for people who wish to implement their own preprocessor for whatever reason.