swaggest / json-diff

JSON diff/rearrange/patch/pointer library for PHP
MIT License
220 stars 30 forks source link

Throw exception when field type is incorrect #60

Closed outdooracorn closed 2 years ago

outdooracorn commented 2 years ago

Another late addition to our improvements on error handling (#53).

Fixes the following edge cases:

codecov[bot] commented 2 years ago

Codecov Report

Merging #60 (f8fcc60) into master (b9da3c5) will increase coverage by 0.09%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #60      +/-   ##
==========================================
+ Coverage   96.85%   96.95%   +0.09%     
==========================================
  Files          14       15       +1     
  Lines         573      591      +18     
==========================================
+ Hits          555      573      +18     
  Misses         18       18              
Impacted Files Coverage Δ
src/InvalidFieldTypeException.php 100.00% <100.00%> (ø)
src/JsonPatch.php 99.06% <100.00%> (+0.05%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

outdooracorn commented 2 years ago

Realised I didn't explain what this PR addresses! :see_no_evil:

We noticed the following edge cases:

The second commit, makes sure test code coverage doesn't decrease. I suggest we ignore the code climate issue. :)