3

I need to validate the rest assured response that has nested json against regular expression

{
  "user": {
    "id": "\\d+",
    "name": "^((?:[A-Za-z]+ ?){1,3})$",
    "requires2fa": "true|false"
  },
  "status": "success|failure"
}

This works fine the json which doesnt have nested json objects.

JSONAssert.assertEquals(
    expectedJson,
    actualJson,
    new CustomComparator(
        JSONCompareMode.LENIENT,
        new Customization("***", new RegularExpressionValueMatcher<>())
    )
);

not sure how to validate nested json in similar way

Sanch
  • 41
  • 4

0 Answers0