Test should extract values from body as it does for headers
Since we have removed the in-line response body, we cannot extract data from the response. This used to work in the same way as headers. However, we need something more flexible that the header parsing - since the values may be embedded in dynamic content.
on branch: extract_response_vars, have added the ability to configure a json-path to extract data:
:rsp {
:200 {
:extract-vars {
"$[0].id" "${usermessageId}"
}
This should also support x-path for application/xml etc.
This fixes endpoint dependencies when calculating path to visit the endpoints.
Not particularly attached to the config naming - suggestions welcome.
better naming would be something like :body-data? A little less imperative...
However, it may be possible to generate a json-path by analysing a body example with placeholders...
Something like:
rsp body example: [{"id": "${ph}", ...},...] would generate "$[0].id" (i.e. id of first result)
I kinda get it... but I don't understand 'This fixes endpoint dependencies when calculating path to visit the endpoints.'. Then again it is too early in the morning :-) Did you mean in reference to auto testing ?
Yes, auto-tests. It would give us a mechanism to to define the source of a variable (currently only header response supported), which the endpoint path calculation will subsequently use. In example above, any endpoint that requires userMessageId as input, must be called after the above endpoint which returns the userMessageId in the response body.
I kinda get it but I'd like to work through it with you.. can't devote enough capacity to it at the moment... lets do it over curry ? :+1: