Compare two json objects

310 views
Skip to first unread message

Marko Hrastovec

unread,
Nov 17, 2017, 3:22:41 AM11/17/17
to Jansson users
Hi,

I just started to use Jansson and I think it is great.

I need to compare to json objects to verify if they are identical. For now I have put them into strings with JSON_SORT_KEYS flag and compare strings. Is there some other more suitable way to do that?

Regards
Marko

Petri Lehtinen

unread,
Nov 17, 2017, 4:45:11 AM11/17/17
to jansso...@googlegroups.com
Hi!

I'm glad to hear you like Jansson :)

You can check the equality if two json_t values with the json_equal() function. See:


Petri 
--
--
Jansson users mailing list
jansso...@googlegroups.com
http://groups.google.com/group/jansson-users
---
You received this message because you are subscribed to the Google Groups "Jansson users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jansson-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marko Hrastovec

unread,
Nov 17, 2017, 9:07:10 AM11/17/17
to Jansson users
Thanks.

I was looking for word "compare" in API reference. :(

Dne petek, 17. november 2017 10.45.11 UTC+1 je oseba Petri Lehtinen napisala:
Reply all
Reply to author
Forward
0 new messages