swaggest / php-json-schema

High definition PHP structures with JSON-schema based validation
MIT License
438 stars 50 forks source link

Move invalid value exception data to dedicated fields #128

Closed vearutop closed 3 years ago

vearutop commented 3 years ago

Fixes https://github.com/swaggest/php-json-schema/issues/126. Fixes #127.

InvalidValue now exposes data and (optionally) expected value.

    public $constraint;
    public $data;
github-actions[bot] commented 3 years ago

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
JSON 22 (+1) 5316 (+22) 5316 (+22) 0 0 0 145.7K (+319B)
Markdown 2 630 (+9) 484 (+6) 0 146 (+3) 0 19.9K (+289B)
PHP 133 11143 (+55) 8065 (+44) 1481 (+8) 1597 (+3) 559 (+3) 322.6K (+2.3K)
codecov[bot] commented 3 years ago

Codecov Report

Merging #128 (bdcc2f8) into master (8dbd73e) will increase coverage by 0.16%. The diff coverage is 100.00%.

:exclamation: Current head bdcc2f8 differs from pull request most recent head ef05a96. Consider uploading reports for the commit ef05a96 to get more accurate results Impacted file tree graph

@@             Coverage Diff              @@
##             master     #128      +/-   ##
============================================
+ Coverage     92.36%   92.53%   +0.16%     
- Complexity      760      764       +4     
============================================
  Files            27       27              
  Lines          1651     1688      +37     
============================================
+ Hits           1525     1562      +37     
  Misses          126      126              
Impacted Files Coverage Δ
src/InvalidValue.php 100.00% <100.00%> (ø)
src/Schema.php 96.10% <100.00%> (+0.18%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8dbd73e...ef05a96. Read the comment docs.