Teajey / serde_json_diff

Create machine-readable JSON diffs
https://crates.io/crates/serde_json_diff
MIT License
6 stars 0 forks source link

`Extra` case is missing value field #2

Open hejfelix opened 1 month ago

hejfelix commented 1 month ago

https://github.com/Teajey/serde_json_diff/blob/8f226c37ab01a70b218d385bcc2676601e0b5859/src/lib.rs#L10

would be nice to know the value in the Extra case like in the Missing case

Teajey commented 1 month ago

The philosophy and the needs that I went into writing this library with was that it should only give you the minimum information needed to make source align with target. So if there's an extra entry in source you only need it to know it's key so you can remove it.

You can find the value of this Extra by swapping your source and target arguments and then it will show up as Missing instead.

I'm happy to review a PR if you really think Extra should contain a value.