Compares two JSON strings and returns whether they represent the same document (thus ignoring things like object ordering or multiple representations of the same number).
Declared in <folly/json/JsonTestUtil.h>
bool
compareJson(
StringPiece json1,
StringPiece json2);
This is implemented by deserializing both strings into dynamic, so it is not efficient and it is meant to only be used in tests.
It will throw an exception if any of the inputs is invalid.
True if both strings represent the same document.
| Name | Description |
|---|---|
| json1 | The first JSON string. |
| json2 | The second JSON string. |