We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5bbb190 commit 001a499Copy full SHA for 001a499
src/main/java/com/mastercard/developer/encryption/JweEncryption.java
@@ -140,7 +140,7 @@ private static DocumentContext decryptPayloadPath(DocumentContext payloadContext
140
//Strip the parent node if empty
141
String jsonPathInStripped = jsonPathIn.replaceAll("." + config.getEncryptedValueFieldName() + "$", "");
142
Object inJsonObjectStripped = readJsonObject(payloadContext, jsonPathIn);
143
- if (inJsonObjectStripped == null) {
+ if (!jsonPathInStripped.equals("$") && !jsonPathInStripped.contains("[") && inJsonObjectStripped == null) {
144
JsonParser.deleteIfExists(payloadContext, jsonPathInStripped);
145
}
146
0 commit comments