josephburnett / jd

JSON diff and patch
MIT License
826 stars 38 forks source link

Translation between formats #39

Closed josephburnett closed 2 years ago

josephburnett commented 2 years ago

Jd now supports JSON and YAML data formats, as well as the native jd diff and a limited subset of the JSON Patch spec. The command line tool should include conversions between appropriate formats.

josephburnett commented 2 years ago

Here is the new flag and the jd2patch translation: https://github.com/josephburnett/jd/commit/b9bfe779ba5c660ccc80ff5d3950b1106eabd9a1

And here is the inverse translation patch2jd: https://github.com/josephburnett/jd/commit/f293709f0855a159e3fd03a731111d2464b45e9a

Here is an example of how to use the jd2patch (applying a jd diff to a Kubernetes deployment): https://github.com/josephburnett/jd/tree/9d0efa1d402606cc2ee6ffe5d00f71c62f5c2261#see-what-changes-in-a-kuberentes-deployment

josephburnett commented 2 years ago

We have jd2patch, patch2jd, json2yaml and yaml2json which is everything we need right now. If we add another format, we'll add more translations.