-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
[feat] add Json::assertMatchesSchema() #102
Conversation
63100d0
to
ef4acbf
Compare
@@ -110,6 +111,26 @@ public function assertThatEach(string $selector, callable $assert): void | |||
foreach ($value as $item) { | |||
$assert(self::encode($item)); | |||
} | |||
|
|||
return $this; |
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.
oops 😅
ef4acbf
to
ab6c074
Compare
} | ||
|
||
$validator = new Validator(); | ||
$decoded = \json_decode($this->source, null, 512, \JSON_THROW_ON_ERROR); |
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.
justinrainbow/json-schema
actually requests a \stdclass
return $this; | ||
} | ||
|
||
public function assertMatchesSchema(string $jsonSchema): self |
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.
I think we should not require a file name here, because it would prevent users to provide json "hard coded"
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.
Agreed
ab6c074
to
41e67a0
Compare
41e67a0
to
f6bec6e
Compare
Thanks @nikophil! |
No description provided.