swaggest / json-diff

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

Add operation index to `PathException` for detailed error reporting #68

Closed MuhammadJaziraly closed 4 months ago

MuhammadJaziraly commented 4 months ago

The reason for this change is to have the index for the operation in cases where two identical operations target the same resource.

For example, if two identical remove operations target the same resource, the latter will fail because the first operation already removed the resource.

By having the index, we can accurately identify and report the failing operation.

vearutop commented 4 months ago

Let's add op index via a setter function instead of constructor, so that there is no breaking change of constructor signature.

MuhammadJaziraly commented 4 months ago

Done ✅