On Tue, Feb 03, 2026 at 09:20:09AM +0100, Aleksandar Lazic wrote: > Subject: json handling in HAProxy > Hi. > > Mia mentioned in > https://www.mail-archive.com/[email protected]/msg46543.html is there > another solution for JSON reading based on > https://github.com/ibireme/yyjson/ instead of the current used mjson lib. > > This library looks nice but have some points which I would like to discuss. > > + yyjson looks active maintained vs mjson which looks stalled > + in yyjson is JSON Path build in instead of handcrafted JSON Query in mjson > - yyjoon looks much bigger then mjson > > That's the Idea of an Roadmap to remove mjson from HAProxy: >
Why ? There's no need to remove mjson from our code, we already removed most of the unnecessary part, there is less than 500 LoC to maintain now. yyjson is more than 20k LoC, if it becomes deprecated at some point this will be the same problem and would be worst for us to maintain. > * My suggestion is to add yyjson and samples for JSON Path similar to JSON > Query > and announce the new feature.. > * Add some helper functions for JSON Query to JSON Path translation. > Luckily in HAProxy isn't the JSON Query really "just" some '$.GET_VALUE"' > Stuff. > * Replace mjson calls with yyjson calls. > * Make JSON Query deprecated. > * Remove mjson from HAProxy code. mjson is already supporting a json path format, it can handle arrays etc. you can do things like "$.foo.bar[1]" If we want to replace the library we should be super careful and test a lot, it's like changing a regex engine, you would have a lot of compatibility issues and breakage. > My questions for a good integration of yyjson into HAProxy. > > Which Memory management handling (pool, dynbuf) can I use based on the doc > of yyjson? > > https://github.com/ibireme/yyjson/blob/master/doc/API.md#memory-allocator > I'm honestly not for changing the whole library, if we do have limitation with the library we should probably do something to extend it or improve it, but I never saw any report about that. -- William Lallemand

