Skip to content

Add failed schema accessor #74

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

Merged
merged 7 commits into from
Apr 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ language: php
php:
- nightly
- hhvm
- 7.3
- 7.2
- 7.1
- 7.0
Expand Down Expand Up @@ -36,5 +37,5 @@ script:
- if [[ $(phpenv version-name) =~ 7.2 ]] ; then php $HOME/.composer/cache/phpstan.phar analyze -l 7 -c phpstan.neon ./src; fi

after_script:
- if [[ $(phpenv version-name) =~ 7.2 ]] ; then php $HOME/.composer/cache/ocular.phar code-coverage:upload --format=php-clover clover.xml; fi
- if [[ $(phpenv version-name) =~ 7.2 ]] ; then $HOME/.composer/cache/cctr after-build --exit-code $TRAVIS_TEST_RESULT; fi
- if [[ $(phpenv version-name) =~ 7.2 ]] ; then php $HOME/.composer/cache/ocular.phar code-coverage:upload --format=php-clover clover.xml; fi
- if [[ $(phpenv version-name) =~ 7.2 ]] ; then $HOME/.composer/cache/cctr after-build --exit-code $TRAVIS_TEST_RESULT; fi
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ For ambiguous schemas defined with `oneOf`/`anyOf` message is indented multi-lin
Processing path is a combination of schema and data pointers. You can use `InvalidValue->getSchemaPointer()`
and `InvalidValue->getDataPointer()` to extract schema/data pointer.

You can receive `Schema` instance that failed validation with `InvalidValue->getFailedSubSchema`.

You can build error tree using `InvalidValue->inspect()`.

### PHP structured classes with validation
Expand Down
9 changes: 2 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
"php": ">=5.4",
"ext-json": "*",
"phplang/scope-exit": "^1.0",
"swaggest/json-diff": "^3.4.2"
"swaggest/json-diff": "^3.5.1"
},
"require-dev": {
"phpunit/phpunit": "4.8.35",
"swaggest/code-builder": "dev-master#e0c5c0612fd241d2d120e5ddef91cda9edc208ee",
"swaggest/php-code-builder": "dev-master#3e643924445eb0f8d13dd011a57a42ce75629892",
"phpunit/php-code-coverage": "2.2.4",
"codeclimate/php-test-reporter": "^0.4.0"
"codeclimate/php-test-reporter": "0.4.0"
},
"license": "MIT",
"authors": [
Expand All @@ -36,9 +34,6 @@
"Swaggest\\JsonSchema\\Tests\\": "tests/src/"
}
},
"scripts": {
"gen-json-struct": "php ./tools/generate_json_structures.php"
},
"config": {
"platform": {
"php": "5.4.45"
Expand Down
Loading