I tried to find a way to test a JSON String using model-assert library without success. Unfortunately, provided use cases and examples are too obvious and didn’t help either.
Here is a simple extract of JSON to give an idea:
{
"level1": {
"level2": {
"items": [
{ "id": 1, "name": "item1" },
{ "id": 2, "name": "item2" },
{ "id": 3, "name": "item3" }
]
}
}
}
The idea is to test the presence of the entry { "id": 2, "name": "item2" }
.
Any ideas?
I also took a look at jsonassert, but their docs are even less clear.
Thank you.