Kevin Lyda on Nostr: I have a chunk of generated JSON that I'm comparing to a good JSON document. ...
I have a chunk of generated JSON that I'm comparing to a good JSON document. Annoyingly testify only provides a single line of context, so I'm writing the actual and expected JSON to check it with diff myself.
Curious if there's a good library for emitting sorted JSON from a string instead of using `jq -rS` as I'm doing here.
https://dpaste.org/5Axfo#go
Published at
2024-10-17 12:38:09Event JSON
{
"id": "870d55e87eed72435de8122ff63abcee068685f27d40de4dc31f79404e6ea6dc",
"pubkey": "a9ea7ec4e0ce3fa6ed2a94c2a0f6ab02a2140daa9965169862dfee836ebe7098",
"created_at": 1729168689,
"kind": 1,
"tags": [
[
"t",
"go"
],
[
"proxy",
"https://mastodon.ie/users/lyda/statuses/113322799219782614",
"activitypub"
]
],
"content": "I have a chunk of generated JSON that I'm comparing to a good JSON document. Annoyingly testify only provides a single line of context, so I'm writing the actual and expected JSON to check it with diff myself.\n\nCurious if there's a good library for emitting sorted JSON from a string instead of using `jq -rS` as I'm doing here.\n\nhttps://dpaste.org/5Axfo\n\n#go",
"sig": "a4caab7a3c785a0e148b9dc168df446696d19d7988271835be15dad69f91a4dafceaa7d3dadbdc0f424cd99731916160a154f7e43df5c65de80ca3f17ac08b1c"
}