Comments (2)
The changeValue
on Del
is present (now) for the sake of computing the change metric used to minimise patches during construction. I should have defined a datatype to represent patches independently from the internal data structure.
In the near future I'll be making a major release which changes aeson-diff
to use the RFC 6902 JSON Patch format. JSON Patch does not include a value on the remove
operation but instead has a separate test
operation which, used together, allows a similar semantics to the traditional behaviour you were expecting.
from aeson-diff.
@srijs I've just merged a branch preparing for a 1.0
release. This replaces the original ad hoc operations and patch format with the operations and JSON encoding defined in RFC 6902.
The Rem
operation still has the non-operational Value
(I may change this before cutting a release) but the semantics you want can now be implemented as described in the RFC using a Tst
immediately succeeded by a Rem
operation :
-- | Delete a
del :: Pointer -> Value -> Patch
del p v = Patch [ Tst p v, Rem p v ]
from aeson-diff.
Related Issues (20)
- add to stackage HOT 2
- ignore null value HOT 7
- Split pointer, patch, diff and apply into modules HOT 1
- Refactor diff algorithm implementation HOT 1
- Add option to generate Tst before Rem
- Make a release HOT 1
- Consider using lens
- Benchmarks
- Add to stackage HOT 1
- Release on hackage HOT 1
- src/patch.hs: error: Ambiguous occurrence โOptionsโ HOT 5
- GHC-8.4.x support (in Hackage) HOT 2
- Does not respect RFC remove specification HOT 2
- Test failures with aeson 1.4.3.0 HOT 1
- Bump dependencies for current LTS HOT 2
- ADD and REMOVE in a vector instead of MOVE HOT 2
- Pretty printing for patches HOT 2
- Library needs a base bump for ghc 9.0.1 HOT 2
- Library does not build with aeson > 2 HOT 2
- ToJSON/FromJSON instances don't roundtrip correctly when using numeric keys
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aeson-diff.