-
Notifications
You must be signed in to change notification settings - Fork 356
Changing the resolution base via 'id' does not work properly #447
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
Comments
@shmax Have you had anything to do with with the ref processing when the scope has been changed? Some insight into how this is intended to work would be handy and would save a lot of time tracing stuff. No worries if not. The tests in |
No, not only was that before my time, but I never really totally figured out how to get $ref functionality working in my own code; I had to resort to overriding the UriResolver and just cheeseballing the resolve method. I looked over this issue, but I think I'm a bit out of my depth; I don"t even know what a "behat" is. I'll see if I can get caught up a bit more this weekend. |
Bugger. Will get to tracing stuff then. Thanks anyway :-). |
For what it's worth, this bug has nothing to do with Behat. Behat just happens to depend on this validator, and @dkarlovi happened to find the bug while using Behat. |
Gotcha. I'll load up his sample app tomorrow and see if I can make any sense of it. |
No need, unless you're curious - the test case at the top of this thread reproduces the bug using only the json-schema validator. |
Behat is irrelevant here, I used it to replicate the bug the only way I knew how. :) |
Same problem here and I have no clue how to get it to work except for writing my own resolver I guess. Can't we just add a getter/setter for the base path for the resolver? This would make all relative file references relative to that path. I can probably cook something up but I'm not sure if it would break stuff as this is a bug apparently. |
@mdeboer This is definitely a bug. I will fix it. Regarding your suggestion of a base path setter... what purpose would this serve? The spec already defines the |
Alright, awaiting the fix then 👍 |
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.
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.
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.
@erayd is this actually backward compatible, will it even land in 5.x? |
@dkarlovi Yes. I very deliberately implemented it in a manner that could be backported to 5.x.x without breaking anything. |
@erayd great, looking forward to seeing it released, thanks! |
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.
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.
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.
* 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.
Per issue #446. See below test case:
@bighappyface Could you please mark this as blocking for 6.0.0? I need to stare at the code some more, but at first look this may require significant refactoring of the
$ref
code.The text was updated successfully, but these errors were encountered: