Skip to content

Sanbox feature #240

@TEMMA-CATS

Description

@TEMMA-CATS

Hi,

Could you please give me a complete example in order to know how to use sandbox option.

{
  "firstName": "John",
  "lastName" : "doe",
  "mainPhoneType": "home",
  "age"      : 26,
  "address"  : {
    "streetAddress": "naist street",
    "city"         : "Nara",
    "postalCode"   : "630-0192"
  },
  "phoneNumbers": [
    {
      "type"  : "iPhone",
      "number": "0123-4567-8888"
    },
    {
      "type"  : "home",
      "number": "0123-4567-8910"
    }
  ]
}

This JsonPath expression:

$.phoneNumbers[?(@.type == "home")].number

return

[
  "0123-4567-8910"
]

I try to use sandbox with map:

{
  "${mainPhoneType}": "home"
}

and

JSONPath({
      path: "$.phoneNumbers[?(@.type == '${mainPhoneType}')].number", wrap: true, json: json, flatten: true, sandbox: sandbox,
    });

but it returns empty array [ ]

Normally from doc it could replace ${mainPhoneType} by home in expression, no?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions