0

I need to get the keys from my backend api using Rest Assured, but most of them are children of another key and have spaces in between, so don't know how to get them?

{
 "success": true,
 "nav": {
    "Settings": "/application/settings/personal",
    "Notification Preferences": "/application/settings/notifications",
    "Reset Password": "/application/settings/reset-password",
    "logout": "/application/logout"
 }
}

It's very similar to this question here but in that case the key wasn't a child of another key. I'm trying to make something like this to work:

.body("'nav.Reset Password'", equalTo("#"))

Thanks for the help. :)

Francislainy Campos
  • 3,462
  • 4
  • 33
  • 81

1 Answers1

1

Hope below snippet will fix your problem.

.body("nav.'Reset Password'", equalTo("#"));

Have to give single quotes for the key only which have space like nav.'Reset Password'. You have given single quotes for complete path('nav.Reset Password' ) this is causing the issue.