Data masking for JSON response array

Anybody know the data masking JSON path expression for a JSON array response like this:

[
  {
    "a": "b"
  }
]

I can't seem to mask any part of the response if the root is an array (rather than a plain object).

Here is the mock target I configured to test this: http://www.mocky.io/v2/59cd1f421100004e00ccca7e

1 8 1,698
8 REPLIES 8

Updated, 2019 August 5

This bug in Apigee Edge has been fixed.

Now, if you want to mask the content of a JSON array, you can set the maskconfig like this :

{
  "jSONPathsRequest": [
    "$[*].a",
    ...
  ],
  ...

Consult the API documentation for the full reference on how to use the maskconfigs API.


Updated, 2019 January 8: this is a bug in Apigee Edge.

This is the way to address a field in a root array, in jsonpath:

$[*].a

If you want a conditional match you can do this:

$[?(@.a == 'something')].otherProperty

This valid syntax does not work in the current (2019 January) versions of Apigee Edge.


I investigated and diagnosed a bug: reference b/122545281 .

The fix should be deployed into production in a relatively short period.

The workaround for now is to have the backend return a JSON object.

Sorry for the inconvenience.

Yep, I've tried that (was my first choice) plus many others including hardcoded indexes, etc. None of them seems to mask a property within an array.

We are also facing the same issue and I was wondering if there is a plan to resolve the path evaluation to deal with this problem. Once I have access to the support portal I will be raising the question. The only other solution I could come up with is to ask the back end service to supply the array in a wrapping element but I would prefer the problem being resolved at source (Apigee).

Noted. Let me look into it.

Hi Peter. Thanks for your note. I investigated and diagnosed the bug; we should be able to correct it and get a fix out. When you contact Apigee Support you can reference b/122545281.

The fixes never get shipped into production fast enough for my tastes. But this shouldn't take long. No promises, but I would guess weeks, rather than months.

That is great Dino. Fingers crossed weeks!

Has there been any movement on the issue (reference b/122545281)?

Yes, this problem is fixed in the Apigee Edge cloud.

The fix will be available in OPDK 19.06.