Skip to content

Add isArray / isList predicate #4520

@jcamiel

Description

@jcamiel

Current predicate https://hurl.dev/docs/asserting-response.html#predicates can't distinguish between object and lists. There is a isCollection but it returns true for bytes, object, list, nodeset so we can't use it to differentiate object and list.

For instance:

{
  "fruits": {
    "name": "lemon"
  }
}

and

{
  "fruits": ["lemon"]
}

Both pass this assert:

GET https://localhost:fruits
HTTP 200
[Asserts]
jsonpath "$.fruits" isCollection

To do:

  • choose name between isArray vs isList
  • make clear in the docs what we call collections (bytes, list, nodeset, object)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions