Skip to content
This repository was archived by the owner on Sep 17, 2022. It is now read-only.

Commit 1ccc503

Browse files
committed
Added reference examples for body
1 parent 7d6eaad commit 1ccc503

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

docs/reference.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,67 @@ Body provides a bit more flexibility on what body to expect in this response.
216216
| subset | bool | no | no | If the `is` block is a subset of the body (or selector content). See [examples](https://github.com/getapid/apid-cli/tree/master/testapi/tests). |
217217
| keysOnly | bool | no | no | If values should be disregarded when checking for equality. All types of values except objects are ignored. Objects will still be recursively checked. See [examples](https://github.com/getapid/apid-cli/tree/master/testapi/tests). |
218218

219+
```yaml
220+
expect:
221+
body:
222+
- is: |
223+
{
224+
"name": {"first": "Tom", "last": "Anderson"},
225+
"age":37,
226+
"children": ["Sara","Alex","Jack"],
227+
"fav.movie": "Deer Hunter",
228+
"friends": [
229+
{"first": "Dale", "last": "Murphy", "age": 44, "nets": ["ig", "fb", "tw"]},
230+
{"first": "Roger", "last": "Craig", "age": 68, "nets": ["fb", "tw"]},
231+
{"first": "Jane", "last": "Murphy", "age": 47, "nets": ["ig", "tw"]}
232+
]
233+
}
234+
- selector: name
235+
is: |
236+
{
237+
"first": "Tom",
238+
"last": "Anderson"
239+
}
240+
241+
- selector: name
242+
keysOnly: true
243+
is: |
244+
{
245+
"first": "Something, but not Tom",
246+
"last": "not Anderson"
247+
}
248+
249+
- selector: name
250+
subset: true
251+
keysOnly: true
252+
is: |
253+
{
254+
"first": "Something, but not Tom"
255+
}
256+
257+
- selector: name
258+
subset: true
259+
is: |
260+
{
261+
"first": "Tom"
262+
}
263+
264+
- selector: friends.#.first
265+
is: |
266+
[
267+
"Dale",
268+
"Jane",
269+
"Roger"
270+
]
271+
272+
- selector: friends.#.first
273+
subset: true
274+
is: |
275+
[
276+
"Rojer"
277+
]
278+
```
279+
219280
## Skip SSL verification
220281

221282
SSL verification can be skipped on all steps in a APId config (suite). Specify the `skip_ssl_verify: True` field

0 commit comments

Comments
 (0)