You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm observing that for any given json response, I'm unable to validate the whole schema of a json response. It is validating the schema only on the top level of the json response. It is not going recursively into all the nested objects in the json response
So if there is json response like this :-
{ "a": 1,
"b": [
{
"x": "abc"
"y": "efg"
}
{
"x": "cba"
"y": "gfa"
}
]
"c": null
}
So now if I try this out in my testscript :-
Hi,
I'm observing that for any given json response, I'm unable to validate the whole schema of a json response. It is validating the schema only on the top level of the json response. It is not going recursively into all the nested objects in the json response
So if there is json response like this :-
{ "a": 1,
"b": [
{
"x": "abc"
"y": "efg"
}
{
"x": "cba"
"y": "gfa"
}
]
"c": null
}
So now if I try this out in my testscript :-
expect_json_types('*',{a: :integer, b: :array_of_objects, x: :string, y: :string, c: :nil})
I'm getting an error saying that :-
Expected x to be of type string
got NilClass instead
But if I give this :-
expect_json_types('*',{a: :integer, b: :array_of_objects, c: :nil})
Then the test passes.
I want to be able to give the whole schema as part of the validation. Even those keys in nested objects.
Either I'm doing this the wrong way or there is an issue with the schema validation. Or I dunno how to do this!... lol...
Please can you guide me on this.
Thanks in advance!
Regards,
VJ
The text was updated successfully, but these errors were encountered: