corka149
A JSON patch is a way to define a sequence of manipulating operations on a JavaScript object. The IETF published the RFC 6902 - found here RFC 6902 - JavaScript Object Notation (JSON) Patch. The Kubernetes API is an user of those JSON patches. In my opinion this is the easiest way to change a Kubernetes resource. Unfortunantely no library was available until yet or I did not fount it. This was my motivation to create the JSON patch library.
- Get Jsonpatch here jsonpatch | Hex
- Read the documentation here Jsonpatch — Jsonpatch v2.3.1
- And source GitHub - corka149/jsonpatch: A implementation of RFC 6902 in pure Elixir. · GitHub
In this sense - keep calm and code Elixir
Your Corka/Sebastian
Trending in Announcing
WebAuthnLiveComponent WebAuthnComponents
See this post about renaming the package.
Passwordless authentication for Phoenix LiveView app...
New
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
I released Doggo, a collection of unstyled Phoenix components.
https://github.com/woylie/doggo
Features
Unstyled Phoenix components....
New
Hi everyone,
I’ve been working on this protobuf library for 3 years. We use it in the company I work for, EasyMile, to communicate with ...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
I’ll shortly be launching Text, a nascent text analysis library.
Current functionality
In this early version (not ready for prime time) ...
New
Following on from my CLDR lbraries I started work on Unicode transforms. But like everything related to CLDR there is a lot of yak-shavin...
New
Other Trending Topics
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with.
But I don’t use it anymore.
Serverless was the promis...
New
What IDE or editor are you using for Elixir development?
Personally, I use Zed, and I really like it, but sometimes I wish there were a ...
New
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ai
- #ecto-query
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
olafura
There was:
But it doesn’t seem to have been updated in a while according to hex. Also when I used that library at my last company I noticed it wasn’t that fast. So there is defiantly room for improvement.
I’m not sure it’s good to rely on a json encoder/decoder.
Also be careful about lists they are not that clear in json patch standard and can cause of lot of problems.
corka149
Thanks for your feedback
Well, my search skills fail. I will have a look at that lib for comparison. But I already saw that it offers a better error feedback. This is currently not the best for Jsonpatch. Anyhow I also have to take a deeper look at performance.
This was historically grown. I just wanted to offer the option for mapping but I build first the encoder/decoder. I will leave it to the consumer of the lib what encoder/coder they want to use. I removed the dependency.
corka149
v0.9.0
The new release added helpful feedback on errors while patching.
In this example the test operation failed.
Other possible errors are
:invalid_pathand:invalid_index.corka149
v0.9.3
It has been a since the last update. I worked on testing to eliminate dead code and bugs (of course). Also I tried to make the documentation a little bit prettier.
I am happy about any feedback.
Your Corka/Sebastian
corka149
v0.10.0
A new minor version is out. Recently I discovered that escaping exists for
~and/. Also “know your standard library”: I was using Enum.with_index + Enum.find which was really not clever and replaced it with Enum.fetch.Breaking change:
Jsonpatch.apply_patch/2was not really matching the Elixir style in my opinion. Therefore it was changed andJsonpatch.apply_patch!/2was added.Before:
Now:
In contrast
Jsonpatch.apply_patch!/2will return no tuple. Instead it will return the patched value orJsonpatchException.Changelog:
Updated documentation: Jsonpatch — Jsonpatch v0.10.0
corka149
v0.11.0
The whole process for creating patches through Jsonpatch.diff/2 was not perfect. I was encouraged through a github issue to rewrite it with a reduce-loop. This version fixes this. In addition, Jsonpatch.FlatMap was removed because it is not necessary anymore and it was not the focus of this lib.
Changelog:
Updated documentation: Jsonpatch — Jsonpatch v0.11.0
corka149
(No version update)
Thanks to
Mix.installit is really easy to write a small script to create a patch with Jsonpatch.It is so small. I love it.
corka149
v0.12.0
After a long time a new release was published.
Previously Jsonpatch sorted the patches before applying them when they were provided as list. This was wrong.
The RFC says that they should be applied in the order as they appear in the list.
This change can affect the result of applying multiple JSON patches.
Updated documentation: Jsonpatch — Jsonpatch v0.12.0
corka149
v0.12.1
The new version brings a better order for generated patches by
Jsonpatch.diff/2when lists were compared.Before v0.12.1
With v0.12.1
Now the created patches can be directly applied and will created the expected destination.
Thanks @smartepsh for the PR
corka149
v0.13.0
A new version is out. It is finally possible to patch maps with atoms as keys.
The new option for
apply_patchwas inspired byJason.New option:
:keys- controls how parts of paths are decoded. Possible values::strings(default) - decodes parts of paths as binary strings,:atoms- parts of paths are converted to atoms usingString.to_atom/1,:atoms!- parts of paths are converted to atoms usingString.to_existing_atom/1Example
Cheers
Sebastian