imbo / behat-api-extension

API extension for Behat, used to ease testing of JSON-based APIs
MIT License
109 stars 42 forks source link

Root numerical array #15

Closed christeredvartsen closed 8 years ago

christeredvartsen commented 8 years ago

Currently there is no way of checking a JSON response that has a numerical array as the root property:

[
    "foo",
    123,
    {
        "foo": "bar"
    }
]

This could be solved by implementing support for the following syntax (that matches existing format):

{
    "[0]": "foo",
    "[1]": 123,
    "[2]": {
        "foo": "bar"
    }
}

This should also support the custom functions (length, atLeast and atMost) and also regular expressions.