-
Notifications
You must be signed in to change notification settings - Fork 30
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
justinrainbow/json-schema version 3/4 #27
base: master
Are you sure you want to change the base?
Conversation
90cce2c
to
572dd7c
Compare
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.
Looks good in general!
@@ -183,28 +183,6 @@ public function testValidateFailsIfSchemaNeitherStringNorObject() | |||
/** | |||
* @expectedException \Webmozart\Json\InvalidSchemaException | |||
*/ | |||
public function testValidateFailsIfSchemaFileContainsNoObject() |
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.
Why did you remove these tests? How does the validator behave now in these cases?
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.
get_object_vars() expects parameter 1 to be object, string given
in justinrainbow/json-schema/src/JsonSchema/SchemaStorage.php:103
. Don't think there's a way to fix it here.
@@ -10,7 +10,7 @@ | |||
], | |||
"require": { | |||
"php": "^5.3.3|^7.0", | |||
"justinrainbow/json-schema": "^2.0", | |||
"justinrainbow/json-schema": "^3.0", |
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.
Is there a reason not to allow both versions 2.x and 3.x?
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.
since yesterday there is also a 4.x
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.
thanks for the hint @staabm! I think it would indeed be good to support all three branches. @thewilkybarkid could you adapt the PR?
6290407
to
5b861a7
Compare
This now supports versions 2, 3 and 4, though it's getting quite messy internally. |
@webmozart, can we get this merged? I just ran into an incompatibility issue and this would help me greatly. |
Ping @webmozart. I now have a schema that v2 appears to fail on, but I can't update due to this library (which is a dependency of Puli, I'm not actually using it myself). |
What is the latest here, is there something outstanding? @webmozart the unit tests are all passing |
Following the advice in jsonrainbow/json-schema#301 I've tried to update the library to v3's way of resolving references.
I've had to remove two tests as I don't think there's a way (as it stands) to make them pass. An upstream change to throw an exception would work, but it doesn't look to be a trivial change.