for-GET / katt

KATT (Klarna API Testing Tool) is an HTTP-based API testing tool for Erlang.
https://github.com/for-GET/katt
Apache License 2.0
119 stars 16 forks source link

`Actual` is unbound/undefined in `runtime_validation` type. #65

Closed mekanixdk closed 6 years ago

mekanixdk commented 6 years ago

Thought I could use runtime_validation to work around https://github.com/for-GET/katt/issues/64 but I cannot get the actual value out of the response.

POST http://httpbin.org/post
> Accept: application/json
> Content-Type: application/json
> User-Agent: KATT
> Content-Type: application/json
{
    "myint":123
}
< 200
< Content-Type: application/json
{
    "json": {
        "myint": {
            "{{type}}": "runtime_validation",
            "erlang": "{pass, [{\"foo\", Actual}]}"
        }   
    }
}

Fails with

{fail,[{not_equal,{"/body/origin/{{runtime_validation}}",
                       {[123,112,97,115,115,44,32,91,123,34,102,111,111,98,97,
                         114,34,44,32,65,99,116,117,97,108,125,93,125,46,126,
                         110,"error",58,
                         [123,["unbound",44,"'Actual'"],125]],
                        undefined},
                       "185.20.241.138"}}]}
andreineculau commented 6 years ago

Thanks a bunch once again!