Skip to content

Commit 29125e5

Browse files
authored
Add failed schema accessor (#74)
Add InvalidValue->getFailedSubSchema to receive schema that failed validation, resolves #73
1 parent def5ca5 commit 29125e5

12 files changed

+2359
-1983
lines changed

Diff for: .travis.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ language: php
22
php:
33
- nightly
44
- hhvm
5+
- 7.3
56
- 7.2
67
- 7.1
78
- 7.0
@@ -36,5 +37,5 @@ script:
3637
- if [[ $(phpenv version-name) =~ 7.2 ]] ; then php $HOME/.composer/cache/phpstan.phar analyze -l 7 -c phpstan.neon ./src; fi
3738

3839
after_script:
39-
- if [[ $(phpenv version-name) =~ 7.2 ]] ; then php $HOME/.composer/cache/ocular.phar code-coverage:upload --format=php-clover clover.xml; fi
40-
- if [[ $(phpenv version-name) =~ 7.2 ]] ; then $HOME/.composer/cache/cctr after-build --exit-code $TRAVIS_TEST_RESULT; fi
40+
- if [[ $(phpenv version-name) =~ 7.2 ]] ; then php $HOME/.composer/cache/ocular.phar code-coverage:upload --format=php-clover clover.xml; fi
41+
- if [[ $(phpenv version-name) =~ 7.2 ]] ; then $HOME/.composer/cache/cctr after-build --exit-code $TRAVIS_TEST_RESULT; fi

Diff for: README.md

+2
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ For ambiguous schemas defined with `oneOf`/`anyOf` message is indented multi-lin
123123
Processing path is a combination of schema and data pointers. You can use `InvalidValue->getSchemaPointer()`
124124
and `InvalidValue->getDataPointer()` to extract schema/data pointer.
125125

126+
You can receive `Schema` instance that failed validation with `InvalidValue->getFailedSubSchema`.
127+
126128
You can build error tree using `InvalidValue->inspect()`.
127129

128130
### PHP structured classes with validation

Diff for: composer.json

+2-7
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66
"php": ">=5.4",
77
"ext-json": "*",
88
"phplang/scope-exit": "^1.0",
9-
"swaggest/json-diff": "^3.4.2"
9+
"swaggest/json-diff": "^3.5.1"
1010
},
1111
"require-dev": {
1212
"phpunit/phpunit": "4.8.35",
13-
"swaggest/code-builder": "dev-master#e0c5c0612fd241d2d120e5ddef91cda9edc208ee",
14-
"swaggest/php-code-builder": "dev-master#3e643924445eb0f8d13dd011a57a42ce75629892",
1513
"phpunit/php-code-coverage": "2.2.4",
16-
"codeclimate/php-test-reporter": "^0.4.0"
14+
"codeclimate/php-test-reporter": "0.4.0"
1715
},
1816
"license": "MIT",
1917
"authors": [
@@ -36,9 +34,6 @@
3634
"Swaggest\\JsonSchema\\Tests\\": "tests/src/"
3735
}
3836
},
39-
"scripts": {
40-
"gen-json-struct": "php ./tools/generate_json_structures.php"
41-
},
4237
"config": {
4338
"platform": {
4439
"php": "5.4.45"

0 commit comments

Comments
 (0)