Assert Array of Objects contains key/value #126
Answered
by
gavv
hmajid2301
asked this question in
Q&A
-
Is there an easy way to assert that an array of objects contains just a specific key. Let's say I have an object like so: {
"username": "dhawanShikhar",
"question_pools": [
{
"pool_name": "draw_me",
"game_name": "drawlosseum",
},
{
"pool_name": "my_unique_pool2",
"game_name": "quibly",
}
]
} I want to check that at least one of the |
Beta Was this translation helpful? Give feedback.
Answered by
gavv
Feb 15, 2021
Replies: 2 comments
-
Hi, I think the closest thing is using JSONPath + Array().Iter() + a loop, see this snippet for details: https://github.com/gavv/httpexpect#json-schema-and-json-path |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
gavv
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I think the closest thing is using JSONPath + Array().Iter() + a loop, see this snippet for details: https://github.com/gavv/httpexpect#json-schema-and-json-path