Find suitable value for oneOf property in parameters. Fix #166 - #168
Open
sloory wants to merge 5 commits into
Open
Find suitable value for oneOf property in parameters. Fix #166#168sloory wants to merge 5 commits into
sloory wants to merge 5 commits into
Conversation
Author
|
this PR fix #166 |
scaytrase
requested changes
Jan 28, 2023
scaytrase
left a comment
Member
There was a problem hiding this comment.
Needs some fixing for negative cases
| foreach ($value as $key => &$val) { | ||
| $childSchema = $this->getChildSchema($schema, (string) $key); | ||
|
|
||
| if (isset($childSchema->oneOf)) { |
Member
There was a problem hiding this comment.
Looks like in this case we should immediately stop validation if we have filled oneOf and none of the schemas matched in findSuitableOneOf.
|
|
||
| try { | ||
| $validator->validate($psrRequest); | ||
| $this->assertTrue(true); |
Member
There was a problem hiding this comment.
this is not proper way how to deal with exceptions and zero assertions. proper way would be (without any try..catch)
$validator->validate($psrRequest);
$this->addToAssrtionsCount(1);
any exception thrown here should break the test and if validate throws one assertTrue(true) is not called anyway
| */ | ||
| final class Issue166Test extends BaseValidatorTest | ||
| { | ||
| public function testIssue166(): void |
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
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.
No description provided.