Skip to content
This repository has been archived by the owner on Apr 20, 2019. It is now read-only.

[BUG] - In a pipelined request, if a URL contains dependent parameters such that "requestParts" generated for it has an "index" field but it's "value" field is empty, the "internals.requestRegex" doesn't match. #99

Closed
adisingh007 opened this issue Sep 16, 2018 · 0 comments

Comments

@adisingh007
Copy link
Contributor

For ex:
The current code works fine for the following payload:

"requests": [
    { 
        "method": "get",
        "path": "/some/path"
    },
    {
        "method": "get",
        "path": "/another/path/$0.something"
    }
]

Assuming that 0th request returns a JSON object:

{ "something": "someValue" }

$0.something is parsed to someValue and the path in 1st request is taken as /another/path/someValue

But let's assume that the 0th request does not return a JSON object but just a string, say, theStringValue

And also assume that the payload is now:

"requests": [
    { 
        "method": "get",
        "path": "/some/path"
    },
    {
        "method": "get",
        "path": "/another/path/$0"
    }
]

we'd expect the path to be parsed as /another/path/theStringValue WHICH DOES NOT HAPPEN.

This is because the internals.requestRegex matches only for $n.something and not just for $n where n is any positive integer.

cadecairos pushed a commit that referenced this issue Sep 20, 2018
Fixes bug where #99, where in path parameters of pipelined requests, `$n` doesn't necessarily have to have a reachable path. This is helpful in cases when the response of a request on which the current request is dependent on, doesn't return a JSON object but just empty strings
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant