akheron / jansson

C library for encoding, decoding and manipulating JSON data
http://www.digip.org/jansson/
Other
3.05k stars 809 forks source link

Petition for json_array_extend_new() #584

Open kennyk-peplink opened 3 years ago

kennyk-peplink commented 3 years ago

During our journey with Jansson library, we've found the _new() series particularly useful.

We have heavily rely on json_object_xxx() and few years ago requested for json_object_update_new() / json_object_update_missing_new() / json_object_update_existing_new() and they works really well so far.

Recently, we come across similar topic when working with json_array_xxx().

We request for supporting json_array_extend_new(array, other), as a shortcut for json_array_extend(array, other); json_decref(other)

with same reason behind.

We did it our own custom build, but it deserves to be implementation officially. Thanks!

ploxiln commented 3 years ago

You might as well submit a pull request to offer this feature :)

kennyk-peplink commented 3 years ago

Thanks for your suggestion, please check my pull requests over there.